clock: ignore cached date for sunrise

Fixes https://github.com/urbit/landscape/issues/190
This commit is contained in:
Tyler Brown Cifu Shuster 2020-12-07 09:32:47 -08:00
parent eca9a00026
commit 1a570e17be

View File

@ -186,10 +186,10 @@ export default class WeatherTile extends React.Component {
const d = data['weather'][0];
const bg = this.colorFromCondition(data);
const sunset = moment(d.date + ' ' + d.astronomy[0].sunset, 'YYYY-MM-DD hh:mm A');
const sunset = moment(moment().format('YYYY-MM-DD') + ' ' + d.astronomy[0].sunset, 'YYYY-MM-DD hh:mm A');
const sunsetDiff = sunset.diff(moment(), 'hours');
const sunrise = moment(d.date + ' ' + d.astronomy[0].sunrise, 'YYYY-MM-DD hh:mm A');
const sunrise = moment(moment().format('YYYY-MM-DD') + ' ' + d.astronomy[0].sunrise, 'YYYY-MM-DD hh:mm A');
let sunriseDiff = sunrise.diff(moment(), 'hours');
if (sunriseDiff > 24) {