mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # src/components/common/Pager.module.css # src/lib/constants.ts # src/lib/yup.ts # src/pages/api/teams/[id]/users/index.ts # src/pages/api/websites/[id]/reports.ts
This commit is contained in:
commit
40cfcd41e9
19 changed files with 135 additions and 92 deletions
15
src/lib/yup.ts
Normal file
15
src/lib/yup.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import moment from 'moment';
|
||||
import * as yup from 'yup';
|
||||
import { UNIT_TYPES } from './constants';
|
||||
|
||||
export const TimezoneTest = yup.string().test(
|
||||
'timezone',
|
||||
() => `Invalid timezone`,
|
||||
value => moment.tz.zone(value) !== null,
|
||||
);
|
||||
|
||||
export const UnitTypeTest = yup.string().test(
|
||||
'unit',
|
||||
() => `Invalid unit`,
|
||||
value => UNIT_TYPES.includes(value),
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue