display time if available
parent
68efbe3410
commit
cb53a49210
|
@ -61,7 +61,7 @@ server = http.createServer(function(req, res) {
|
|||
if (pathname === "/weather/current") {
|
||||
res.writeHead(200, {'Content-Type': 'application/json'});
|
||||
res.write(JSON.stringify({
|
||||
"time": new Date(),
|
||||
"time": Math.floor(new Date().getTime()/1000),
|
||||
"temperature": 24,
|
||||
"pressure": 101361.7,
|
||||
"humidity": 55,
|
||||
|
|
|
@ -73,6 +73,7 @@ class CurrentConditions {
|
|||
return (
|
||||
<Layout>
|
||||
<h1 class="title">Current Conditions</h1>
|
||||
{Weather.current.time && (<h2 class="subtitle">as of {new Date(Weather.current.time*1000).toLocaleString()}</h2>)}
|
||||
<MeasurementList>
|
||||
<Measurement title="Temperature" value={localeTemperature(Weather.current.temperature)} />
|
||||
<Measurement title="Feels like" value={localeTemperature(feelsLike(Weather.current.temperature, Weather.current.humidity))} />
|
||||
|
|
Loading…
Reference in New Issue