This commit is contained in:
Brian Cao 2023-09-26 12:30:35 -07:00
parent e6eb9a487e
commit febf085aca

View File

@ -21,11 +21,11 @@ export function getFilterValidation(matchRegex) {
export const TimezoneTest = yup.string().test(
'timezone',
() => `Invalid timezone`,
value => !value || !moment.tz.zone(value),
value => moment.tz.zone(value) !== null,
);
export const UnitTypeTest = yup.string().test(
'unit',
() => `Invalid unit`,
value => !value || !UNIT_TYPES.includes(value),
value => UNIT_TYPES.includes(value),
);