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 files changed
+135
-92
No files matched your search
@@ -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),
|
||||
);
|
||||
Reference in new issue
Block a user