[%
USE Number.Format(DECIMAL_DIGITS=1);
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;
-%]
Forecast
Currently
- Temperature:
- [% cur.temperature|round %]°
- Summary:
- [% cur.summary %]
Hour
- Summary:
- [% f.minutely.summary %]
Day
- Summary:
- [% hourly.summary %]
Week
- Summary:
- [% f.daily.summary %]
Today
- Summary:
- [% today.summary %]
- Min temperature:
- [% today.temperatureMin|round %]° [% time(today.temperatureMinTime) %]
- Max temperature:
- [% today.temperatureMax|round %]° [% time(today.temperatureMaxTime) %]
- Sunrise:
- [% time(today.sunriseTime) %]
- Sunset:
- [% time(today.sunsetTime) %]
Line | Destination | When |
[% FOREACH p IN b.predictions %]
[% p.lineName %] |
[% p.destinationName %] |
[% minsec_until(p.expectedArrival) %] |
[% END %]
[% FOR h IN hourly.data; BREAK IF loop.last %]
[% h.summary %] |
[% time(h.time) %] |
[% h.temperature|round %]° |
[% END %]
Line | Status | Details |
[% FOREACH line IN t.lines %]
[% line.name %] |
[% line.status.statusSeverityDescription %] |
[% line.status.reason %] |
[% END %]