Merge branch 'master' into dev

This commit is contained in:
Mike Cao 2023-09-22 17:21:01 -07:00
commit bdf1de424a
4 changed files with 15 additions and 21 deletions

View file

@ -78,7 +78,9 @@ export function parseDateRange(value, locale = 'en-US') {
const endDate = new Date(+endTime);
return {
...getDateRangeValues(startDate, endDate),
startDate,
endDate,
unit: getMinimumUnit(startDate, endDate),
value,
};
}
@ -255,14 +257,6 @@ export function getMinimumUnit(startDate, endDate) {
return 'year';
}
export function getDateRangeValues(startDate, endDate) {
return {
startDate: startOfDay(startDate),
endDate: endOfDay(endDate),
unit: getMinimumUnit(startDate, endDate),
};
}
export function getDateFromString(str) {
const [ymd, hms] = str.split(' ');
const [year, month, day] = ymd.split('-');