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:
parent
e70d50928b
commit
a67ab81541
2 changed files with 8 additions and 6 deletions
|
@ -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} />
|
||||
}
|
||||
/>
|
||||
)
|
||||
|
|
|
@ -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())) {
|
Loading…
Reference in a new issue