@thi.ng/date 2.5.5 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/api.js +45 -55
- package/checks.js +8 -17
- package/datetime.js +318 -321
- package/duration.js +53 -97
- package/format.js +243 -388
- package/i18n/de.js +77 -81
- package/i18n/en.js +77 -81
- package/i18n/es.js +42 -43
- package/i18n/fr.js +44 -45
- package/i18n/it.js +44 -45
- package/i18n.js +47 -118
- package/internal/precision.js +6 -16
- package/iterators.js +41 -93
- package/package.json +10 -7
- package/relative.js +108 -168
- package/round.js +77 -124
- package/timecode.js +19 -43
- package/units.js +21 -16
package/i18n/de.js
CHANGED
|
@@ -1,83 +1,79 @@
|
|
|
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
|
-
less: "< %s",
|
|
35
|
-
past: "vor %s",
|
|
36
|
-
now: "jetzt",
|
|
37
|
-
future: "in %s",
|
|
1
|
+
const DE_SHORT = {
|
|
2
|
+
months: [
|
|
3
|
+
"Jan",
|
|
4
|
+
"Feb",
|
|
5
|
+
"M\xE4r",
|
|
6
|
+
"Apr",
|
|
7
|
+
"Mai",
|
|
8
|
+
"Jun",
|
|
9
|
+
"Jul",
|
|
10
|
+
"Aug",
|
|
11
|
+
"Sep",
|
|
12
|
+
"Okt",
|
|
13
|
+
"Nov",
|
|
14
|
+
"Dez"
|
|
15
|
+
],
|
|
16
|
+
days: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
|
|
17
|
+
sepED: ", ",
|
|
18
|
+
sepDM: ".",
|
|
19
|
+
sepMY: ".",
|
|
20
|
+
date: ["d", "/DM", "M", "/MY", "yyyy"],
|
|
21
|
+
units: {
|
|
22
|
+
y: { s: "J.", p: "J." },
|
|
23
|
+
M: { s: "Mo.", p: "Mo." },
|
|
24
|
+
d: { s: "T.", p: "T." },
|
|
25
|
+
h: { s: "Std.", p: "Std." },
|
|
26
|
+
m: { s: "Min.", p: "Min." },
|
|
27
|
+
s: { s: "Sek.", p: "Sek." },
|
|
28
|
+
t: { s: "ms", p: "ms" }
|
|
29
|
+
},
|
|
30
|
+
less: "< %s",
|
|
31
|
+
past: "vor %s",
|
|
32
|
+
now: "jetzt",
|
|
33
|
+
future: "in %s"
|
|
38
34
|
};
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
35
|
+
const DE_LONG = {
|
|
36
|
+
months: [
|
|
37
|
+
"Januar",
|
|
38
|
+
"Februar",
|
|
39
|
+
"M\xE4rz",
|
|
40
|
+
"April",
|
|
41
|
+
"Mai",
|
|
42
|
+
"Juni",
|
|
43
|
+
"Juli",
|
|
44
|
+
"August",
|
|
45
|
+
"September",
|
|
46
|
+
"Oktober",
|
|
47
|
+
"November",
|
|
48
|
+
"Dezember"
|
|
49
|
+
],
|
|
50
|
+
days: [
|
|
51
|
+
"Sonntag",
|
|
52
|
+
"Montag",
|
|
53
|
+
"Dienstag",
|
|
54
|
+
"Mittwoch",
|
|
55
|
+
"Donnerstag",
|
|
56
|
+
"Freitag",
|
|
57
|
+
"Samstag"
|
|
58
|
+
],
|
|
59
|
+
sepED: ", ",
|
|
60
|
+
sepDM: ". ",
|
|
61
|
+
sepMY: " ",
|
|
62
|
+
units: {
|
|
63
|
+
y: { s: "Jahr", p: "Jahre", pd: "Jahren" },
|
|
64
|
+
M: { s: "Monat", p: "Monate", pd: "Monaten" },
|
|
65
|
+
d: { s: "Tag", p: "Tage", pd: "Tagen" },
|
|
66
|
+
h: { s: "Stunde", p: "Stunden" },
|
|
67
|
+
m: { s: "Minute", p: "Minuten" },
|
|
68
|
+
s: { s: "Sekunde", p: "Sekunden" },
|
|
69
|
+
t: { s: "Millisekunde", p: "Millisekunden" }
|
|
70
|
+
},
|
|
71
|
+
less: "weniger als %s",
|
|
72
|
+
past: "vor %s",
|
|
73
|
+
now: "jetzt",
|
|
74
|
+
future: "in %s"
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
DE_LONG,
|
|
78
|
+
DE_SHORT
|
|
83
79
|
};
|
package/i18n/en.js
CHANGED
|
@@ -1,83 +1,79 @@
|
|
|
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
|
-
less: "< %s",
|
|
34
|
-
past: "%s ago",
|
|
35
|
-
now: "just now",
|
|
36
|
-
future: "in %s",
|
|
1
|
+
const EN_SHORT = {
|
|
2
|
+
months: [
|
|
3
|
+
"Jan",
|
|
4
|
+
"Feb",
|
|
5
|
+
"Mar",
|
|
6
|
+
"Apr",
|
|
7
|
+
"May",
|
|
8
|
+
"Jun",
|
|
9
|
+
"Jul",
|
|
10
|
+
"Aug",
|
|
11
|
+
"Sep",
|
|
12
|
+
"Oct",
|
|
13
|
+
"Nov",
|
|
14
|
+
"Dec"
|
|
15
|
+
],
|
|
16
|
+
days: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
17
|
+
sepHM: ".",
|
|
18
|
+
date: ["dd", "/DM", "MM", "/MY", "yyyy"],
|
|
19
|
+
time: ["h", "/HM", "mm", " ", "a"],
|
|
20
|
+
units: {
|
|
21
|
+
y: { s: "y", p: "y" },
|
|
22
|
+
M: { s: "m", p: "m" },
|
|
23
|
+
d: { s: "d", p: "d" },
|
|
24
|
+
h: { s: "h", p: "h" },
|
|
25
|
+
m: { s: "min", p: "min" },
|
|
26
|
+
s: { s: "s", p: "s" },
|
|
27
|
+
t: { s: "ms", p: "ms" }
|
|
28
|
+
},
|
|
29
|
+
less: "< %s",
|
|
30
|
+
past: "%s ago",
|
|
31
|
+
now: "just now",
|
|
32
|
+
future: "in %s"
|
|
37
33
|
};
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
34
|
+
const EN_LONG = {
|
|
35
|
+
months: [
|
|
36
|
+
"January",
|
|
37
|
+
"February",
|
|
38
|
+
"March",
|
|
39
|
+
"April",
|
|
40
|
+
"May",
|
|
41
|
+
"June",
|
|
42
|
+
"July",
|
|
43
|
+
"August",
|
|
44
|
+
"September",
|
|
45
|
+
"October",
|
|
46
|
+
"November",
|
|
47
|
+
"December"
|
|
48
|
+
],
|
|
49
|
+
days: [
|
|
50
|
+
"Sunday",
|
|
51
|
+
"Monday",
|
|
52
|
+
"Tuesday",
|
|
53
|
+
"Wednesday",
|
|
54
|
+
"Thursday",
|
|
55
|
+
"Friday",
|
|
56
|
+
"Saturday"
|
|
57
|
+
],
|
|
58
|
+
sepDM: " ",
|
|
59
|
+
sepMY: " ",
|
|
60
|
+
sepHM: ".",
|
|
61
|
+
time: ["h", "/HM", "mm", " ", "a"],
|
|
62
|
+
units: {
|
|
63
|
+
y: { s: "year", p: "years" },
|
|
64
|
+
M: { s: "month", p: "months" },
|
|
65
|
+
d: { s: "day", p: "days" },
|
|
66
|
+
h: { s: "hour", p: "hours" },
|
|
67
|
+
m: { s: "minute", p: "minutes" },
|
|
68
|
+
s: { s: "second", p: "seconds" },
|
|
69
|
+
t: { s: "millisecond", p: "milliseconds" }
|
|
70
|
+
},
|
|
71
|
+
less: "less than %s",
|
|
72
|
+
past: "%s ago",
|
|
73
|
+
now: "just now",
|
|
74
|
+
future: "in %s"
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
EN_LONG,
|
|
78
|
+
EN_SHORT
|
|
83
79
|
};
|
package/i18n/es.js
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
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
|
-
future: "en %s",
|
|
1
|
+
const ES_LONG = {
|
|
2
|
+
months: [
|
|
3
|
+
"enero",
|
|
4
|
+
"febrero",
|
|
5
|
+
"marzo",
|
|
6
|
+
"abril",
|
|
7
|
+
"mayo",
|
|
8
|
+
"junio",
|
|
9
|
+
"julio",
|
|
10
|
+
"agosto",
|
|
11
|
+
"septiembre",
|
|
12
|
+
"octubre",
|
|
13
|
+
"noviembre",
|
|
14
|
+
"diciembre"
|
|
15
|
+
],
|
|
16
|
+
days: [
|
|
17
|
+
"domingo",
|
|
18
|
+
"lunes",
|
|
19
|
+
"martes",
|
|
20
|
+
"mi\xE9rcoles",
|
|
21
|
+
"jueves",
|
|
22
|
+
"viernes",
|
|
23
|
+
"s\xE1bado"
|
|
24
|
+
],
|
|
25
|
+
sepDM: " ",
|
|
26
|
+
sepMY: " ",
|
|
27
|
+
units: {
|
|
28
|
+
y: { s: "a\xF1o", p: "a\xF1os" },
|
|
29
|
+
M: { s: "mes", p: "meses" },
|
|
30
|
+
d: { s: "d\xEDa", p: "d\xEDas" },
|
|
31
|
+
h: { s: "hora", p: "horas" },
|
|
32
|
+
m: { s: "minuto", p: "minutos" },
|
|
33
|
+
s: { s: "segundo", p: "segundos" },
|
|
34
|
+
t: { s: "millisegundo", p: "millisegundos" }
|
|
35
|
+
},
|
|
36
|
+
less: "menos de %s",
|
|
37
|
+
past: "hace %s",
|
|
38
|
+
now: "ahora",
|
|
39
|
+
future: "en %s"
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
ES_LONG
|
|
44
43
|
};
|
package/i18n/fr.js
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
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
|
-
future: "dans %s",
|
|
1
|
+
const FR_LONG = {
|
|
2
|
+
months: [
|
|
3
|
+
"janvier",
|
|
4
|
+
"f\xE9vrier",
|
|
5
|
+
"mars",
|
|
6
|
+
"avril",
|
|
7
|
+
"mai",
|
|
8
|
+
"juin",
|
|
9
|
+
"juillet",
|
|
10
|
+
"aout",
|
|
11
|
+
"septembre",
|
|
12
|
+
"octobre",
|
|
13
|
+
"novembre",
|
|
14
|
+
"d\xE9cembre"
|
|
15
|
+
],
|
|
16
|
+
days: [
|
|
17
|
+
"dimanche",
|
|
18
|
+
"lundi",
|
|
19
|
+
"mardi",
|
|
20
|
+
"mercredi",
|
|
21
|
+
"jeudi",
|
|
22
|
+
"vendredi",
|
|
23
|
+
"samedi"
|
|
24
|
+
],
|
|
25
|
+
sepDM: " ",
|
|
26
|
+
sepMY: " ",
|
|
27
|
+
sepHM: "h ",
|
|
28
|
+
units: {
|
|
29
|
+
y: { s: "ann\xE9e", sd: "an", p: "ans" },
|
|
30
|
+
M: { s: "mois", p: "mois" },
|
|
31
|
+
d: { s: "jour", sd: "journ\xE9e", p: "jours" },
|
|
32
|
+
h: { s: "heure", p: "heures" },
|
|
33
|
+
m: { s: "minute", p: "minutes" },
|
|
34
|
+
s: { s: "seconde", p: "secondes" },
|
|
35
|
+
t: { s: "milliseconde", p: "millisecondes" }
|
|
36
|
+
},
|
|
37
|
+
less: "moins de %s",
|
|
38
|
+
past: "il y a %s",
|
|
39
|
+
now: "\xE0 pr\xE9sent",
|
|
40
|
+
// https://www.thoughtco.com/learn-essential-french-prepositions-4078684
|
|
41
|
+
future: "dans %s"
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
FR_LONG
|
|
46
45
|
};
|
package/i18n/it.js
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
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
|
-
future: "in %s",
|
|
1
|
+
const IT_LONG = {
|
|
2
|
+
months: [
|
|
3
|
+
"gennaio",
|
|
4
|
+
"febbraio",
|
|
5
|
+
"marzo",
|
|
6
|
+
"aprile",
|
|
7
|
+
"maggio",
|
|
8
|
+
"giugno",
|
|
9
|
+
"luglio",
|
|
10
|
+
"agosto",
|
|
11
|
+
"settembre",
|
|
12
|
+
"ottobre",
|
|
13
|
+
"novembre",
|
|
14
|
+
"dicembre"
|
|
15
|
+
],
|
|
16
|
+
days: [
|
|
17
|
+
"domenica",
|
|
18
|
+
"luned\xEC",
|
|
19
|
+
"marted\xEC",
|
|
20
|
+
"mercoled\xEC",
|
|
21
|
+
"gioved\xEC",
|
|
22
|
+
"venerd\xEC",
|
|
23
|
+
"sabato"
|
|
24
|
+
],
|
|
25
|
+
sepDM: " ",
|
|
26
|
+
sepMY: " ",
|
|
27
|
+
sepHM: ".",
|
|
28
|
+
units: {
|
|
29
|
+
y: { s: "anno", p: "anni" },
|
|
30
|
+
M: { s: "mese", p: "mesi" },
|
|
31
|
+
d: { s: "giorno", p: "giorni" },
|
|
32
|
+
h: { s: "ora", p: "ore" },
|
|
33
|
+
m: { s: "minuto", p: "minuti" },
|
|
34
|
+
s: { s: "secondo", p: "secondi" },
|
|
35
|
+
t: { s: "millisecondo", p: "millisecondi" }
|
|
36
|
+
},
|
|
37
|
+
less: "meno di %s",
|
|
38
|
+
past: "%s fa",
|
|
39
|
+
// https://dailyitalianwords.com/ora-vs-adesso/
|
|
40
|
+
now: "ora",
|
|
41
|
+
future: "in %s"
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
IT_LONG
|
|
46
45
|
};
|