mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-30 13:41:50 +02:00
allow undefined timezone in yup
This commit is contained in:
parent
0e782f3bcc
commit
8cc7657b1b
|
@ -2,7 +2,10 @@ import moment from 'moment';
|
||||||
import * as yup from 'yup';
|
import * as yup from 'yup';
|
||||||
import { UNIT_TYPES } from './constants';
|
import { UNIT_TYPES } from './constants';
|
||||||
|
|
||||||
export const TimezoneTest = yup.string().test(
|
export const TimezoneTest = yup
|
||||||
|
.string()
|
||||||
|
.default('UTC')
|
||||||
|
.test(
|
||||||
'timezone',
|
'timezone',
|
||||||
() => `Invalid timezone`,
|
() => `Invalid timezone`,
|
||||||
value => moment.tz.zone(value) !== null,
|
value => moment.tz.zone(value) !== null,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user