MCPcopy Index your code
hub / github.com/simstudioai/sim / parseTimeString

Function parseTimeString

apps/sim/lib/workflows/schedules/utils.ts:128–135  ·  view source on GitHub ↗
(timeString: string | undefined | null)

Source from the content-addressed store, hash-verified

126 * @returns Array with [hours, minutes] as numbers, or [9, 0] as default
127 */
128export function parseTimeString(timeString: string | undefined | null): [number, number] {
129 if (!timeString || !timeString.includes(':')) {
130 return [9, 0] // Default to 9:00 AM
131 }
132
133 const [hours, minutes] = timeString.split(':').map(Number)
134 return [Number.isNaN(hours) ? 9 : hours, Number.isNaN(minutes) ? 0 : minutes]
135}
136
137/**
138 * Get time values from starter block for scheduling

Callers 3

utils.test.tsFile · 0.90
getScheduleTimeValuesFunction · 0.85
createDateWithTimezoneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected