WK 0d217e466f
refactor: optimization (#5362)
* chore(deps): bump RA versions

* chore(deps): bump RA versions

* chore(deps): bump RA versions

* chore: changeset

* chore(deps): remove unnecessary dependencies

* fix(calendar): typing issue

* refactor(system): remove unused SupportedCalendars

* refactor(system): move I18nProviderProps to type

* refactor: use `spectrumCalendarProps<DateValue>["createCalendar"]`

* feat: add consistent-type-imports

* fix: eslint

* chore: add changeset

* refactor: remove unused deps
2025-06-09 14:17:44 +08:00

25 lines
809 B
TypeScript

import type {DateValue} from "@internationalized/date";
import React from "react";
import {DateInput} from "@heroui/react";
import {now, parseAbsoluteToLocal} from "@internationalized/date";
export default function App() {
let [date, setDate] = React.useState<DateValue | null>(
parseAbsoluteToLocal("2021-04-07T18:45:22Z"),
);
return (
<div className="w-full max-w-xl flex flex-col items-start gap-4">
<DateInput granularity="second" label="Date and time" value={date} onChange={setDate} />
<DateInput granularity="day" label="Date" value={date} onChange={setDate} />
<DateInput granularity="second" label="Event date" />
<DateInput
granularity="second"
label="Event date"
placeholderValue={now("America/New_York")}
/>
</div>
);
}