UNPKG

455 BTypeScriptView Raw
1import React, { useState } from "react";
2
3import { UTCDate } from "@date-fns/utc";
4import { DayPicker } from "react-day-picker/utc";
5
6export function Utc() {
7 const [selected, setSelected] = useState<Date>(new UTCDate());
8 return (
9 <DayPicker
10 mode="single"
11 required
12 selected={selected}
13 onSelect={(date: Date) => {
14 setSelected(date);
15 }}
16 footer={selected ? `${selected.toUTCString()}` : null}
17 />
18 );
19}