Fix refresh button issue, closes #840
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user