replace-datetime API - v5.0.1
    Preparing search index...

    Variable DatetimeConst

    Datetime: ForwardRefExoticComponent<
        DateTimeProps & RefAttributes<DatetimeHandle>,
    > = ...

    A fully-featured, accessible datetime picker component for React 18 and 19.

    Datetime supports date-only, time-only, and combined date+time modes. It can be used as a floating picker attached to an <input> or as an inline (static) calendar embedded directly in your layout.

    The component is a controlled-or-uncontrolled hybrid — pass value for controlled mode, or initialValue for uncontrolled mode.

    A ref can be attached to access imperative methods:

    • ref.current.setViewDate(date) — navigate the calendar to a specific date
    • ref.current.navigate(viewMode) — switch the active view programmatically
    • ref.current.state — read current internal state
    import Datetime from 'replace-datetime';
    import 'replace-datetime/css/react-datetime.css';

    function DateOnlyPicker() {
    const [date, setDate] = useState<moment.Moment>();
    return (
    <Datetime
    value={date}
    timeFormat={false}
    onChange={(v) => { if (moment.isMoment(v)) setDate(v); }}
    />
    );
    }
    <Datetime input={false} onChange={(v) => console.log(v)} />