Download next.js/.github/actions/next-repo-actions/lib/util.mjs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/.github/actions/next-repo-actions/lib/util.mjs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/.github/actions/next-repo-actions/lib/util.mjs
-
curl -L -o util.mjs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/.github/actions/next-repo-actions/lib/util.mjs
524 Bytes
| import { getExecOutput } from '@actions/exec' | |
| import { setFailed } from '@actions/core' | |
| // format date to <month|short> <day|numeric>, <year|numeric> | |
| export function formattedDate(createdAt) { | |
| const date = new Date(createdAt) | |
| return date.toLocaleDateString('en-US', { | |
| month: 'short', | |
| day: 'numeric', | |
| year: 'numeric', | |
| }) | |
| } | |
| // Get the date 90 days ago (YYYY-MM-DD) | |
| export function ninetyDaysAgo() { | |
| const date = new Date() | |
| date.setDate(date.getDate() - 90) | |
| return date.toISOString().split('T')[0] | |
| } | |