1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2025-01-03 12:34:20 +00:00

Rename HumanDate to FestaMoment

This commit is contained in:
Steffo 2022-06-09 23:55:49 +02:00
parent e70d50928b
commit a67ab81541
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,5 @@
import { HTMLProps } from "react";
import { HumanDate } from "../HumanDate";
import { FestaMoment } from "../extensions/FestaMoment";
import { Editable } from "./Editable";
export function EditableDateTimeLocal(props: HTMLProps<HTMLInputElement> & { value: Date }) {
@ -9,7 +9,7 @@ export function EditableDateTimeLocal(props: HTMLProps<HTMLInputElement> & { val
<input type="datetime-local" {...props} value={props.value.toISOString()} />
}
preview={
<HumanDate date={props.value} />
<FestaMoment date={props.value} />
}
/>
)

View file

@ -4,8 +4,10 @@ type HumanDateProps = {
date: Date
}
export function HumanDate({date}: HumanDateProps) {
/**
* Component that formats a {@link Date} to a machine-readable and human-readable HTML `time[datetime]` element.
*/
export function FestaMoment({ date }: HumanDateProps) {
const { t } = useTranslation()
if (Number.isNaN(date.getTime())) {