[% cur = f.currently; today = f.daily.data.0; today_start = f.hourly.data.0.time.clone today_stop = f.hourly.data.0.time.clone.add('days'=>1); hourly = f.hourly.slice('from', today_start, 'to', today_stop); MACRO hours_length(span) BLOCK; d=span.stop_time.subtract_datetime(span.start_time); format_duration( 'pattern','%k', 'base',span.start_time, 'normalize',1).format_duration(d); END; MACRO time(d) BLOCK; d.clone.set_time_zone('Europe/London').strftime('%H:%M'); END; MACRO minsec_until(d) BLOCK; dur=d.subtract_datetime(now); format_duration( 'pattern','%M:%S', 'base',now, 'normalize',1).format_duration(dur); END; -%]
Line | Destination | When |
---|---|---|
[% p.LineName %] | [% p.DestinationText %] | [% minsec_until(p.EstimatedTime) %] |