@tempots/dom

emitValueAsDate() function

Converts the value of an HTML input element to a Date object and emits it using the provided callback function.

Signature:

emitValueAsDate: (fn: (date: Date) => void) => (event: Event) => void

Parameters

Parameter

Type

Description

fn

(date: Date) => void

The callback function to be called with the converted Date object.

Returns: (event: Event) => void

A function that can be used as an event handler for input events.