Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Function: coerceIfDate()

coerceIfDate(type, value): unknown

Returns the value as a Date when the type is date and conversion succeeds.

Parameters

type

the value type.

keyof SchemaTypeMap | undefined

value

unknown

the value to coerce.

Returns

unknown

the Date when conversion succeeds, otherwise the original value.

Stay in the know
Quickly Build Drag-and-Drop Forms
Star us on GitHub