Download next.js/examples/blog-with-comment/lib/dateRelative.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 218 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/blog-with-comment/lib/dateRelative.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/blog-with-comment/lib/dateRelative.ts
-
curl -L -o dateRelative.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/blog-with-comment/lib/dateRelative.ts
218 Bytes
| import formatDistanceToNowStrict from "date-fns/formatDistanceToNowStrict"; | |
| export default function distanceToNow(dateTime: number | Date) { | |
| return formatDistanceToNowStrict(dateTime, { | |
| addSuffix: true, | |
| }); | |
| } | |