mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fix refresh button issue, closes #840
This commit is contained in:
parent
7b7557ec90
commit
504b5f10d9
3 changed files with 6 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue