-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate-consts.js
More file actions
78 lines (69 loc) · 1.25 KB
/
date-consts.js
File metadata and controls
78 lines (69 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
*/
export const ISO_8601_DURATION_PATTERN = /^P(?:(?<years>\d+)Y)?(?:(?<months>\d+(\.\d+)?)M)?(?:(?<weeks>\d+(\.\d+)?)W)?(?:(?<days>\d+(\.\d+)?)D)?(?:T(?:(?<hours>\d+(\.\d+)?)H)?(?:(?<minutes>\d+(\.\d+)?)M)?(?:(?<seconds>\d+(\.\d+)?)S)?)?$/;
export const SECONDS = 1000;
export const MINUTES = 60 * SECONDS;
export const HOURS = 60 * MINUTES;
export const DAYS = 24 * HOURS;
export const WEEKS = 7 * DAYS;
export const YEARS = 365 * DAYS;
export const days = [{
name: 'Sunday',
short: 'Sun',
}, {
name: 'Monday',
short: 'Mon',
}, {
name: 'Tuesday',
short: 'Tue',
}, {
name: 'Wednesday',
short: 'Wed',
}, {
name: 'Thursday',
short: 'Thu',
}, {
name: 'Friday',
short: 'Fri',
}, {
name: 'Saturday',
short: 'Sat',
}];
export const months = [{
name: 'January',
short: 'Jan',
}, {
name: 'February',
short: 'Feb',
}, {
name: 'March',
short: 'Mar',
}, {
name: 'April',
short: 'April',
}, {
name: 'May',
short: 'May',
}, {
name: 'June',
short: 'June',
}, {
name: 'July',
short: 'July',
}, {
name: 'August',
short: 'Aug',
}, {
name: 'September',
short: 'Sep',
}, {
name: 'October',
short: 'Oct',
}, {
name: 'November',
short: 'Nov',
}, {
name: 'December',
short: 'Dec',
}];