DateIsoConverter
ts
const DateIsoConverter: ConverterFactory<Date | undefined, [boolean?]>;
Converts an iso date attribute to a Date
object and vice versa. The short
parameter can be used to convert the date to a short iso date string (s. datetime
attribute).
Param
If true, converts to a short iso date string, like 2025-07-12
(default: false).
Example
typescript
class MyComponent extends LitElement {
@property({
type: Date,
reflect: true,
attribute: 'my-date',
converter: DateIsoConverter(),
})
myDate = new Date();
}