mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
* 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
25 lines
809 B
TypeScript
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>
|
|
);
|
|
}
|