|
Last change
on this file was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
796 bytes
|
| Line | |
|---|
| 1 | import {timeInterval} from "./interval.js";
|
|---|
| 2 |
|
|---|
| 3 | export const timeMonth = timeInterval((date) => {
|
|---|
| 4 | date.setDate(1);
|
|---|
| 5 | date.setHours(0, 0, 0, 0);
|
|---|
| 6 | }, (date, step) => {
|
|---|
| 7 | date.setMonth(date.getMonth() + step);
|
|---|
| 8 | }, (start, end) => {
|
|---|
| 9 | return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|---|
| 10 | }, (date) => {
|
|---|
| 11 | return date.getMonth();
|
|---|
| 12 | });
|
|---|
| 13 |
|
|---|
| 14 | export const timeMonths = timeMonth.range;
|
|---|
| 15 |
|
|---|
| 16 | export const utcMonth = timeInterval((date) => {
|
|---|
| 17 | date.setUTCDate(1);
|
|---|
| 18 | date.setUTCHours(0, 0, 0, 0);
|
|---|
| 19 | }, (date, step) => {
|
|---|
| 20 | date.setUTCMonth(date.getUTCMonth() + step);
|
|---|
| 21 | }, (start, end) => {
|
|---|
| 22 | return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|---|
| 23 | }, (date) => {
|
|---|
| 24 | return date.getUTCMonth();
|
|---|
| 25 | });
|
|---|
| 26 |
|
|---|
| 27 | export const utcMonths = utcMonth.range;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.