Download node_modules/d3-time/src/month.js from NKessler/Horizon: direct link, hf CLI and curl.
- Browser
- Download file 796 Bytes
-
https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-time/src/month.js
- Command line
-
hf download hf://NKessler/Horizon/node_modules/d3-time/src/month.js
-
curl -L -o month.js https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-time/src/month.js
796 Bytes
| import {timeInterval} from "./interval.js"; | |
| export const timeMonth = timeInterval((date) => { | |
| date.setDate(1); | |
| date.setHours(0, 0, 0, 0); | |
| }, (date, step) => { | |
| date.setMonth(date.getMonth() + step); | |
| }, (start, end) => { | |
| return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; | |
| }, (date) => { | |
| return date.getMonth(); | |
| }); | |
| export const timeMonths = timeMonth.range; | |
| export const utcMonth = timeInterval((date) => { | |
| date.setUTCDate(1); | |
| date.setUTCHours(0, 0, 0, 0); | |
| }, (date, step) => { | |
| date.setUTCMonth(date.getUTCMonth() + step); | |
| }, (start, end) => { | |
| return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; | |
| }, (date) => { | |
| return date.getUTCMonth(); | |
| }); | |
| export const utcMonths = utcMonth.range; | |