mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
8ca73268ba
2 changed files with 8 additions and 11 deletions
|
|
@ -23,12 +23,5 @@ if (!process.env.SKIP_DB_CHECK && !process.env.DATABASE_TYPE) {
|
|||
}
|
||||
|
||||
if (process.env.CLOUD_URL) {
|
||||
checkMissing([
|
||||
'CLOUD_URL',
|
||||
'CLICKHOUSE_URL',
|
||||
'REDIS_URL',
|
||||
'KAFKA_BROKER',
|
||||
'KAFKA_URL',
|
||||
'KAFKA_SASL_MECHANISM',
|
||||
]);
|
||||
checkMissing(['CLOUD_URL', 'CLICKHOUSE_URL', 'REDIS_URL']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,9 +122,8 @@ export function parseDateValue(value: string) {
|
|||
if (!match) return null;
|
||||
|
||||
const { num, unit } = match.groups;
|
||||
const formattedNum = +num > 0 ? +num - 1 : +num;
|
||||
|
||||
return { num: formattedNum, unit };
|
||||
return { num: +num, unit };
|
||||
}
|
||||
|
||||
export function parseDateRange(value: string, locale = 'en-US'): DateRange {
|
||||
|
|
@ -158,7 +157,12 @@ export function parseDateRange(value: string, locale = 'en-US'): DateRange {
|
|||
|
||||
const now = new Date();
|
||||
const dateLocale = getDateLocale(locale);
|
||||
const { num = 1, unit } = parseDateValue(value);
|
||||
const { unit } = parseDateValue(value);
|
||||
let { num = 1 } = parseDateValue(value);
|
||||
|
||||
if (value === '7day') {
|
||||
num--;
|
||||
}
|
||||
|
||||
switch (unit) {
|
||||
case 'hour':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue