File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// lib/validations.ts
2- < < < << << HEAD
32import { supportedLanguages } from './i18n/badgeLabels' ;
4- === === =
5- >>> >>> > 39 f3891 ( test ( validation ) : add invalid timezone boundary checks )
63import { z } from 'zod' ;
74import {
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 ) ,
You can’t perform that action at this time.
0 commit comments