Download next.js/examples/cms-prismic/components/date.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-prismic/components/date.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-prismic/components/date.tsx
-
curl -L -o date.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-prismic/components/date.tsx
414 Bytes
| import { asDate } from "@prismicio/helpers"; | |
| import { DateField } from "@prismicio/types"; | |
| const formatter = new Intl.DateTimeFormat("en-US", { | |
| month: "long", | |
| day: "numeric", | |
| year: "numeric", | |
| }); | |
| type DateProps = { | |
| dateField: DateField; | |
| }; | |
| export default function Date({ dateField }: DateProps) { | |
| const date = asDate(dateField); | |
| return <time dateTime={dateField}>{formatter.format(date)}</time>; | |
| } | |