Skip to content

Commit e60f4ca

Browse files
committed
test(validation): add invalid timezone boundary checks
1 parent dd604cd commit e60f4ca

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

lib/validations.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// lib/validations.ts
2-
<<<<<<< HEAD
32
import { supportedLanguages } from './i18n/badgeLabels';
4-
=======
5-
>>>>>>> 39f3891 (test(validation): add invalid timezone boundary checks)
63
import { z } from 'zod';
74
import {
85
isValidHex,
@@ -188,21 +185,6 @@ const baseStreakParamsSchema = z.object({
188185
},
189186
{ message: 'Invalid "to" date format. Use ISO 8601 (e.g. 2023-12-31).' }
190187
),
191-
tz: z
192-
.string()
193-
.optional()
194-
.refine(
195-
(val) => {
196-
if (!val) return true;
197-
try {
198-
new Intl.DateTimeFormat(undefined, { timeZone: val });
199-
return true;
200-
} catch {
201-
return false;
202-
}
203-
},
204-
{ message: 'Invalid timezone. Must be a valid IANA timezone (e.g. America/New_York).' }
205-
),
206188
refresh: z.string().optional().transform(toRefreshFlag),
207189
hide_title: z.string().optional().transform(toBooleanFlag),
208190
hide_background: z.string().optional().transform(toBooleanFlag),

0 commit comments

Comments
 (0)