@@ -66,15 +66,15 @@ const [encodeMinute, decodeMinue] = makeCalendarSpecFieldCoders(
66
66
67
67
const [ encodeHour , decodeHour ] = makeCalendarSpecFieldCoders (
68
68
'hour' ,
69
- ( x : number ) => ( typeof x === 'number' && x >= 0 && x <= 59 ? x : undefined ) ,
69
+ ( x : number ) => ( typeof x === 'number' && x >= 0 && x <= 23 ? x : undefined ) ,
70
70
( x : number ) => x ,
71
71
[ { start : 0 , end : 0 , step : 0 } ] , // default to 0
72
72
[ { start : 0 , end : 23 , step : 1 } ]
73
73
) ;
74
74
75
75
const [ encodeDayOfMonth , decodeDayOfMonth ] = makeCalendarSpecFieldCoders (
76
76
'dayOfMonth' ,
77
- ( x : number ) => ( typeof x === 'number' && x >= 0 && x <= 6 ? x : undefined ) ,
77
+ ( x : number ) => ( typeof x === 'number' && x >= 0 && x <= 31 ? x : undefined ) ,
78
78
( x : number ) => x ,
79
79
[ { start : 1 , end : 31 , step : 1 } ] , // default to *
80
80
[ { start : 1 , end : 31 , step : 1 } ]
@@ -139,7 +139,7 @@ function makeCalendarSpecFieldCoders<Unit>(
139
139
const value = encodeValueFn ( item as Unit ) ;
140
140
if ( value !== undefined ) return { start : value , end : value , step : 1 } ;
141
141
}
142
- throw new Error ( `Invalid CalendarSpec component for field ${ fieldName } : '${ item } ' of type '${ typeof item } '` ) ;
142
+ throw new TypeError ( `Invalid CalendarSpec component for field ${ fieldName } : '${ item } ' of type '${ typeof item } '` ) ;
143
143
} ) ;
144
144
}
145
145
@@ -349,7 +349,7 @@ export async function decodeScheduleAction(
349
349
workflowTaskTimeout : optionalTsToMs ( pb . startWorkflow . workflowTaskTimeout ) ,
350
350
} ;
351
351
}
352
- throw new Error ( 'Unsupported schedule action' ) ;
352
+ throw new TypeError ( 'Unsupported schedule action' ) ;
353
353
}
354
354
355
355
export function decodeSearchAttributes (
@@ -397,7 +397,7 @@ export function decodeScheduleRecentActions(
397
397
firstExecutionRunId : executionResult . startWorkflowResult ! . runId ! ,
398
398
} ,
399
399
} ;
400
- } else throw new Error ( 'Unsupported schedule action' ) ;
400
+ } else throw new TypeError ( 'Unsupported schedule action' ) ;
401
401
402
402
return {
403
403
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
0 commit comments