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
491 B
TypeScript
Raw Normal View History

2022-06-08 17:14:00 +00:00
import { HTMLProps } from "react";
2022-06-09 21:55:49 +00:00
import { FestaMoment } from "../extensions/FestaMoment";
2022-06-08 17:14:00 +00:00
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={
2022-06-09 21:55:49 +00:00
<FestaMoment date={props.value} />
2022-06-08 17:14:00 +00:00
}
/>
)
}