diff options
| author | Yuval Adam <_@yuv.al> | 2020-10-03 15:48:31 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-10-03 15:48:31 +0300 |
| commit | e22a2e5b03eaf26d2790931e06ba87c8e8891e21 (patch) | |
| tree | 4c800fb344aef069f9e9a69b4940199a223a432c /iss | |
| parent | d2e887e5794fa984f977043e757796dc2a10d91c (diff) | |
Render time zone name and offset
Diffstat (limited to 'iss')
| -rw-r--r-- | iss/templates/passes.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/iss/templates/passes.html b/iss/templates/passes.html index d89dbef..39478d4 100644 --- a/iss/templates/passes.html +++ b/iss/templates/passes.html @@ -7,6 +7,7 @@ {% block content %} <div id="passes"> <p class="f3">Passes for {{ location.lat }}, {{ location.lng }}</p> + <p class="f4">Times localized for <span class="light-gray">[[ tz.name ]]</span> (UTC[[ tz.offset ]])</p> <table class="tl pa1 w-100"> <tr class="pa1 f3"> <th colspan="1">Total</th> @@ -67,6 +68,13 @@ hour12: false }, computed: { + tz: function() { + var offset = new Date().getTimezoneOffset() / -60; + return { + "name": Intl.DateTimeFormat().resolvedOptions().timeZone, + "offset": offset >= 0 ? "+" + offset : offset + } + }, localizedPredictions: function() { var hour12 = this.hour12; var preds = this.predictions.map(function(p) { |
