1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 15:14:23 +00:00
festa/components/editable/EditableDateTimeLocal.tsx

16 lines
474 B
TypeScript
Raw Normal View History

2022-06-08 17:14:00 +00:00
import { HTMLProps } from "react";
import { HumanDate } from "../HumanDate";
import { Editable } from "./Editable";
export function EditableDateTimeLocal(props: HTMLProps<HTMLInputElement> & { value: Date }) {
return (
<Editable
editing={
<input type="datetime-local" {...props} value={props.value.toISOString()} />
}
preview={
<HumanDate date={props.value} />
}
/>
)
}