From e22a2e5b03eaf26d2790931e06ba87c8e8891e21 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sat, 3 Oct 2020 15:48:31 +0300 Subject: Render time zone name and offset --- iss/templates/passes.html | 8 ++++++++ 1 file changed, 8 insertions(+) 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 %}

Passes for {{ location.lat }}, {{ location.lng }}

+

Times localized for [[ tz.name ]] (UTC[[ tz.offset ]])

@@ -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) { -- cgit v1.3.1
Total