1 | import React, { useState } from "react";
|
2 |
|
3 | import { UTCDate } from "@date-fns/utc";
|
4 | import { DayPicker } from "react-day-picker/utc";
|
5 |
|
6 | export 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 | }
|