Fix realtime.

pull/1873/head
Brian Cao 2023-04-03 23:22:20 -07:00
parent c30aa4c0b6
commit 76296bc2ee
1 changed files with 3 additions and 3 deletions

View File

@ -180,9 +180,9 @@ export function getDateArray(data, startDate, endDate, unit) {
const [diff, add, normalize] = dateFuncs[unit]; const [diff, add, normalize] = dateFuncs[unit];
const n = diff(endDate, startDate) + 1; const n = diff(endDate, startDate) + 1;
function findData(t) { function findData(date) {
const d = data.find(({ x }) => { const d = data.find(({ t }) => {
return normalize(getDateFromString(x)).getTime() === t.getTime(); return normalize(getDateFromString(t)).getTime() === date.getTime();
}); });
return d?.y || 0; return d?.y || 0;