handle date in current conditions
parent
7f9f6595e9
commit
836f99555c
|
@ -10,10 +10,19 @@ var CurrentView = {
|
|||
return Weather.loadCurrent();
|
||||
},
|
||||
view: function() {
|
||||
|
||||
let timeHeading = null;
|
||||
if (Weather.current !== null && Weather.current.time) {
|
||||
const currentTime = new Date(Weather.current.time*1000);
|
||||
timeHeading = m('h2.subtitle',
|
||||
'as of ' + currentTime.toLocaleString()
|
||||
);
|
||||
}
|
||||
|
||||
return m('div.section', [m('div.container',
|
||||
(Weather.current == null) ? [m('.notification', 'Loading current conditions...')] : [
|
||||
m('h1.title', 'Current Conditions'),
|
||||
m('h2.subtitle', 'as of ' + Weather.current.time),
|
||||
timeHeading,
|
||||
m('.level', [
|
||||
m('.level-item.has-text-centered', m("div",[
|
||||
m('p.heading"', 'Temperature'),
|
||||
|
|
Loading…
Reference in New Issue