Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

allow undefined timezone in yup

Francis Cao8cc7657b1bf0
diff --git a/src/lib/yup.ts b/src/lib/yup.ts
index 2407f7ad6..5bd0aa183 100644
--- a/src/lib/yup.ts
+++ b/src/lib/yup.ts
@@ -2,11 +2,14 @@ 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 TimezoneTest = yup
+ .string()
+ .default('UTC')
+ .test(
+ 'timezone',
+ () => `Invalid timezone`,
+ value => moment.tz.zone(value) !== null,
+ );
export const UnitTypeTest = yup.string().test(
'unit',