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

Function getPart

apps/sim/lib/workflows/schedules/utils.ts:253–254  ·  view source on GitHub ↗
(type: Intl.DateTimeFormatPartTypes)

Source from the content-addressed store, hash-verified

251
252 const parts = formatter.formatToParts(tentativeUTCDate)
253 const getPart = (type: Intl.DateTimeFormatPartTypes) =>
254 parts.find((p) => p.type === type)?.value
255
256 const formattedYear = Number.parseInt(getPart('year') || '0', 10)
257 const formattedMonth = Number.parseInt(getPart('month') || '0', 10) // 1-based

Callers 1

createDateWithTimezoneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected