From 7252575b72f6a574947e002b54a8c62c9656bd88 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sat, 3 Oct 2020 17:12:28 +0300 Subject: Add passes display options --- iss/templates/passes.html | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/iss/templates/passes.html b/iss/templates/passes.html index 57dfb5d..2037d82 100644 --- a/iss/templates/passes.html +++ b/iss/templates/passes.html @@ -8,6 +8,12 @@

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

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

+
+ + + + +
@@ -27,25 +33,25 @@ - + - +
TotalTime Azimuth
[[ pred.length_mins ]] [[ pred.date ]] [[ pred.rise.time ]] - [[ pred.rise.direction ]] - [[ pred.rise.azimuth ]] + [[ pred.rise.direction ]] + [[ pred.rise.azimuth ]]° [[ pred.culminate.time ]] - [[ pred.culminate.direction ]] - [[ pred.culminate.azimuth ]] + [[ pred.culminate.direction ]] + [[ pred.culminate.azimuth ]]° [[ pred.culminate.degrees ]][[ pred.culminate.degrees ]]° [[ pred.culminate.distance ]] [[ pred.set.time ]] - [[ pred.set.direction ]] - [[ pred.set.azimuth ]] + [[ pred.set.direction ]] + [[ pred.set.azimuth ]]°
@@ -64,7 +70,10 @@ delimiters: ["[[","]]"], data: { predictions: {{ predictions_json|safe }}, - hour12: false + display: { + hour12: false, + degrees: true + }, }, computed: { tz: function() { @@ -75,8 +84,8 @@ } }, localizedPredictions: function() { - var hour12 = this.hour12; - var preds = this.predictions.map(function(p) { + var hour12 = this.display.hour12; + var preds = JSON.parse(JSON.stringify(this.predictions)).map(function(p) { p.date = new Date(p.rise.time).toLocaleDateString(); p.rise.time = new Date(p.rise.time).toLocaleTimeString([], { hour12 }); p.culminate.time = new Date(p.culminate.time).toLocaleTimeString([], { hour12 }); -- cgit v1.3.1