Add support for MySQL.
This commit is contained in:
@@ -97,7 +97,9 @@ export function getDateArray(data, startDate, endDate, unit) {
|
||||
const n = diff(endDate, startDate) + 1;
|
||||
|
||||
function findData(t) {
|
||||
const x = data.find(e => new Date(e.t).getTime() === normalize(new Date(t)).getTime());
|
||||
const x = data.find(e => {
|
||||
return getLocalTime(new Date(e.t)).getTime() === normalize(new Date(t)).getTime();
|
||||
});
|
||||
|
||||
return x?.y || 0;
|
||||
}
|
||||
@@ -109,5 +111,7 @@ export function getDateArray(data, startDate, endDate, unit) {
|
||||
arr.push({ t, y });
|
||||
}
|
||||
|
||||
console.log({ unit, arr });
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user