Fix refresh button issue, closes #840

This commit is contained in:
Mike Cao committed 2021-12-19 22:49:08 -08:00
1 parent 7b7557ec90
commit 504b5f10d9
3 files changed
+6 -7

No files matched your search

+5 -1
View File
@@ -39,7 +39,11 @@ export function getDateRange(value, locale = 'en-US') {
const now = new Date();
const dateLocale = getDateLocale(locale);
const { num, unit } = value.match(/^(?<num>[0-9]+)(?<unit>hour|day|week|month|year)$/).groups;
const match = value.match(/^(?<num>[0-9]+)(?<unit>hour|day|week|month|year)$/);
if (!match) return;
const { num, unit } = match.groups;
if (+num === 1) {
switch (unit) {