Fixing 24 hour forecast
This commit is contained in:
@@ -194,6 +194,8 @@ function summarise(slots) {
|
|||||||
// Min/max temp uses ALL slots for the full day range
|
// Min/max temp uses ALL slots for the full day range
|
||||||
const allTemps = slots.map(s => s.temperature).filter(Number.isFinite)
|
const allTemps = slots.map(s => s.temperature).filter(Number.isFinite)
|
||||||
|
|
||||||
|
console.log(slots);
|
||||||
|
|
||||||
const labelCount = {}
|
const labelCount = {}
|
||||||
for (const s of source) labelCount[s.label] = (labelCount[s.label] || 0) + 1
|
for (const s of source) labelCount[s.label] = (labelCount[s.label] || 0) + 1
|
||||||
const label = Object.entries(labelCount).sort((a, b) => b[1] - a[1])[0][0]
|
const label = Object.entries(labelCount).sort((a, b) => b[1] - a[1])[0][0]
|
||||||
|
|||||||
Reference in New Issue
Block a user