Reapply "Fixed realtime chart for relational. Removed getDateArray. Added chart min/max dates."

This reverts commit 5e5b61dc7e.
This commit is contained in:
Mike Cao 2024-08-22 13:15:48 -07:00
parent 5e5b61dc7e
commit 8f934d2552
7 changed files with 46 additions and 46 deletions

View file

@ -273,19 +273,6 @@ export function getMinimumUnit(startDate: number | Date, endDate: number | Date)
return 'year';
}
export function getDateFromString(str: string) {
const [ymd, hms] = str.split(' ');
const [year, month, day] = ymd.split('-');
if (hms) {
const [hour, min, sec] = hms.split(':');
return new Date(+year, +month - 1, +day, +hour, +min, +sec);
}
return new Date(+year, +month - 1, +day);
}
export function getDateArray(data: any[], startDate: Date, endDate: Date, unit: string) {
const arr = [];
const { diff, add, start } = DATE_FUNCTIONS[unit];