Added daytime property
This commit is contained in:
@@ -79,7 +79,7 @@ app.get('/api/hourly', async (req, res) => {
|
||||
historyEnd.setMinutes(0, 0, 0)
|
||||
|
||||
const [historyResult] = await Promise.allSettled([
|
||||
start < now ? queryHourly(start.toISOString(), historyEnd.toISOString()) : Promise.resolve([])
|
||||
start < now ? queryHourly(start, historyEnd) : Promise.resolve([])
|
||||
])
|
||||
const history = historyResult.status === 'fulfilled' ? historyResult.value : []
|
||||
|
||||
@@ -112,13 +112,13 @@ app.get('/api/daily', async (req, res) => {
|
||||
const coords = await getCoords()
|
||||
|
||||
// Does the requested window overlap with today (the 24h forecast window)?
|
||||
const todayStr = now.toISOString().slice(0, 10)
|
||||
const todayStr = now
|
||||
const { summary } = await ensureForecast()
|
||||
const usePhysics = summary && start <= next && end >= now
|
||||
|
||||
// Past influx history (days before today)
|
||||
const [sensorResult] = await Promise.allSettled([
|
||||
start < now ? queryDaily(start.toISOString(), now.toISOString()) : Promise.resolve([])
|
||||
start < now ? queryDaily(start, now) : Promise.resolve([])
|
||||
])
|
||||
const history = sensorResult.status === 'fulfilled' ? sensorResult.value : []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user