date-and-time 2.0.1 → 2.1.0
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/LOCALE.md +1 -0
- package/README.md +14 -0
- package/date-and-time.js +27 -23
- package/date-and-time.min.js +8 -8
- package/esm/date-and-time.es.js +27 -23
- package/esm/date-and-time.es.min.js +12 -11
- package/esm/date-and-time.mjs +27 -23
- package/esm/locale/sv.es.js +22 -0
- package/esm/locale/sv.mjs +22 -0
- package/locale/sv.js +30 -0
- package/package.json +3 -3
package/LOCALE.md
CHANGED
package/README.md
CHANGED
|
@@ -24,6 +24,20 @@ npm i date-and-time
|
|
|
24
24
|
|
|
25
25
|
## Recent Changes
|
|
26
26
|
|
|
27
|
+
- 2.1.0
|
|
28
|
+
- Fixed an issue that the lib's functions assigned to variables using ES6 destructuring assignment cause an error.
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
// Destructuring assignment
|
|
32
|
+
const { format, parse } = require('date-and-time');
|
|
33
|
+
|
|
34
|
+
// These used to be errors in 2.0.x.
|
|
35
|
+
format(new Date(), 'MMM DD YYYY');
|
|
36
|
+
parse('Jan 11 2022', 'MMM DD YYYY');
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Added Swedish support.
|
|
40
|
+
|
|
27
41
|
- 2.0.1
|
|
28
42
|
- Fixed a bug that the timezone plugin does not support changing locales.
|
|
29
43
|
|
package/date-and-time.js
CHANGED
|
@@ -128,12 +128,13 @@
|
|
|
128
128
|
obj.res = res;
|
|
129
129
|
}
|
|
130
130
|
return obj;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
},
|
|
132
|
+
proto = {
|
|
133
|
+
_formatter: _formatter,
|
|
134
|
+
_parser: _parser
|
|
135
|
+
},
|
|
136
|
+
localized_proto,
|
|
137
|
+
date;
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
140
|
* Compiling a format string
|
|
@@ -157,10 +158,10 @@
|
|
|
157
158
|
* @returns {string} a formatted string
|
|
158
159
|
*/
|
|
159
160
|
proto.format = function (dateObj, arg, utc) {
|
|
160
|
-
var pattern = typeof arg === 'string' ?
|
|
161
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
161
162
|
offset = dateObj.getTimezoneOffset(),
|
|
162
|
-
d =
|
|
163
|
-
formatter =
|
|
163
|
+
d = ctx.addMinutes(dateObj, utc ? offset : 0),
|
|
164
|
+
formatter = ctx._formatter, str = '';
|
|
164
165
|
|
|
165
166
|
d.getTimezoneOffset = function () { return utc ? 0 : offset; };
|
|
166
167
|
for (var i = 1, len = pattern.length, token; i < len; i++) {
|
|
@@ -177,9 +178,9 @@
|
|
|
177
178
|
* @returns {Object} a date structure
|
|
178
179
|
*/
|
|
179
180
|
proto.preparse = function (dateString, arg) {
|
|
180
|
-
var pattern = typeof arg === 'string' ?
|
|
181
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
181
182
|
dt = { Y: 1970, M: 1, D: 1, H: 0, A: 0, h: 0, m: 0, s: 0, S: 0, Z: 0, _index: 0, _length: 0, _match: 0 },
|
|
182
|
-
comment = /\[(.*)]/, parser =
|
|
183
|
+
comment = /\[(.*)]/, parser = ctx._parser, offset = 0;
|
|
183
184
|
|
|
184
185
|
dateString = parser.pre(dateString);
|
|
185
186
|
for (var i = 1, len = pattern.length, token, result; i < len; i++) {
|
|
@@ -217,9 +218,9 @@
|
|
|
217
218
|
* @returns {Date} a constructed date
|
|
218
219
|
*/
|
|
219
220
|
proto.parse = function (dateString, arg, utc) {
|
|
220
|
-
var dt =
|
|
221
|
+
var ctx = this || date, dt = ctx.preparse(dateString, arg);
|
|
221
222
|
|
|
222
|
-
if (
|
|
223
|
+
if (ctx.isValid(dt)) {
|
|
223
224
|
dt.M -= dt.Y < 100 ? 22801 : 1; // 22801 = 1900 * 12 + 1
|
|
224
225
|
if (utc || dt.Z) {
|
|
225
226
|
return new Date(Date.UTC(dt.Y, dt.M, dt.D, dt.H, dt.m + dt.Z, dt.s, dt.S));
|
|
@@ -236,8 +237,8 @@
|
|
|
236
237
|
* @returns {boolean} whether the date string is a valid date
|
|
237
238
|
*/
|
|
238
239
|
proto.isValid = function (arg1, arg2) {
|
|
239
|
-
var dt = typeof arg1 === 'string' ?
|
|
240
|
-
last = [31, 28 +
|
|
240
|
+
var ctx = this || date, dt = typeof arg1 === 'string' ? ctx.preparse(arg1, arg2) : arg1,
|
|
241
|
+
last = [31, 28 + ctx.isLeapYear(dt.Y) | 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][dt.M - 1];
|
|
241
242
|
|
|
242
243
|
return !(
|
|
243
244
|
dt._index < 1 || dt._length < 1 || dt._index - dt._length || dt._match < 1 ||
|
|
@@ -256,7 +257,8 @@
|
|
|
256
257
|
* @returns {string} a formatted string
|
|
257
258
|
*/
|
|
258
259
|
proto.transform = function (dateString, arg1, arg2, utc) {
|
|
259
|
-
|
|
260
|
+
const ctx = this || date;
|
|
261
|
+
return ctx.format(ctx.parse(dateString, arg1), arg2, utc);
|
|
260
262
|
};
|
|
261
263
|
|
|
262
264
|
/**
|
|
@@ -266,7 +268,7 @@
|
|
|
266
268
|
* @returns {Date} a date after adding the value
|
|
267
269
|
*/
|
|
268
270
|
proto.addYears = function (dateObj, years) {
|
|
269
|
-
return this.addMonths(dateObj, years * 12);
|
|
271
|
+
return (this || date).addMonths(dateObj, years * 12);
|
|
270
272
|
};
|
|
271
273
|
|
|
272
274
|
/**
|
|
@@ -302,7 +304,7 @@
|
|
|
302
304
|
* @returns {Date} a date after adding the value
|
|
303
305
|
*/
|
|
304
306
|
proto.addHours = function (dateObj, hours) {
|
|
305
|
-
return this.addMinutes(dateObj, hours * 60);
|
|
307
|
+
return (this || date).addMinutes(dateObj, hours * 60);
|
|
306
308
|
};
|
|
307
309
|
|
|
308
310
|
/**
|
|
@@ -312,7 +314,7 @@
|
|
|
312
314
|
* @returns {Date} a date after adding the value
|
|
313
315
|
*/
|
|
314
316
|
proto.addMinutes = function (dateObj, minutes) {
|
|
315
|
-
return this.addSeconds(dateObj, minutes * 60);
|
|
317
|
+
return (this || date).addSeconds(dateObj, minutes * 60);
|
|
316
318
|
};
|
|
317
319
|
|
|
318
320
|
/**
|
|
@@ -322,7 +324,7 @@
|
|
|
322
324
|
* @returns {Date} a date after adding the value
|
|
323
325
|
*/
|
|
324
326
|
proto.addSeconds = function (dateObj, seconds) {
|
|
325
|
-
return this.addMilliseconds(dateObj, seconds * 1000);
|
|
327
|
+
return (this || date).addMilliseconds(dateObj, seconds * 1000);
|
|
326
328
|
};
|
|
327
329
|
|
|
328
330
|
/**
|
|
@@ -406,8 +408,8 @@
|
|
|
406
408
|
}
|
|
407
409
|
};
|
|
408
410
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
+
localized_proto = extend(proto);
|
|
412
|
+
date = extend(proto);
|
|
411
413
|
|
|
412
414
|
/**
|
|
413
415
|
* Changing locale
|
|
@@ -469,6 +471,8 @@
|
|
|
469
471
|
}
|
|
470
472
|
};
|
|
471
473
|
|
|
472
|
-
|
|
474
|
+
var date$1 = date;
|
|
475
|
+
|
|
476
|
+
return date$1;
|
|
473
477
|
|
|
474
478
|
}));
|
package/date-and-time.min.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
date-and-time (c) KNOWLEDGECODE | MIT
|
|
3
3
|
*/
|
|
4
|
-
'use strict';(function(
|
|
4
|
+
'use strict';(function(p,m){"object"===typeof exports&&"undefined"!==typeof module?module.exports=m():"function"===typeof define&&define.amd?define(m):(p="undefined"!==typeof globalThis?globalThis:p||self,p.date=m())})(this,function(){var p={},m={},r="en",t={MMMM:"January February March April May June July August September October November December".split(" "),MMM:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dddd:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
|
|
5
5
|
ddd:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dd:"Su Mo Tu We Th Fr Sa".split(" "),A:["AM","PM"]},w={YYYY:function(a){return("000"+a.getFullYear()).slice(-4)},YY:function(a){return("0"+a.getFullYear()).slice(-2)},Y:function(a){return""+a.getFullYear()},MMMM:function(a){return this.res.MMMM[a.getMonth()]},MMM:function(a){return this.res.MMM[a.getMonth()]},MM:function(a){return("0"+(a.getMonth()+1)).slice(-2)},M:function(a){return""+(a.getMonth()+1)},DD:function(a){return("0"+a.getDate()).slice(-2)},
|
|
6
6
|
D:function(a){return""+a.getDate()},HH:function(a){return("0"+a.getHours()).slice(-2)},H:function(a){return""+a.getHours()},A:function(a){return this.res.A[11<a.getHours()|0]},hh:function(a){return("0"+(a.getHours()%12||12)).slice(-2)},h:function(a){return""+(a.getHours()%12||12)},mm:function(a){return("0"+a.getMinutes()).slice(-2)},m:function(a){return""+a.getMinutes()},ss:function(a){return("0"+a.getSeconds()).slice(-2)},s:function(a){return""+a.getSeconds()},SSS:function(a){return("00"+a.getMilliseconds()).slice(-3)},
|
|
7
7
|
SS:function(a){return("0"+(a.getMilliseconds()/10|0)).slice(-2)},S:function(a){return""+(a.getMilliseconds()/100|0)},dddd:function(a){return this.res.dddd[a.getDay()]},ddd:function(a){return this.res.ddd[a.getDay()]},dd:function(a){return this.res.dd[a.getDay()]},Z:function(a){a=a.getTimezoneOffset()/.6|0;return(0<a?"-":"+")+("000"+Math.abs(a-(a%100*.4|0))).slice(-4)},post:function(a){return a},res:t},x={YYYY:function(a){return this.exec(/^\d{4}/,a)},Y:function(a){return this.exec(/^\d{1,4}/,a)},
|
|
8
8
|
MMMM:function(a){a=this.find(this.res.MMMM,a);a.value++;return a},MMM:function(a){a=this.find(this.res.MMM,a);a.value++;return a},MM:function(a){return this.exec(/^\d\d/,a)},M:function(a){return this.exec(/^\d\d?/,a)},DD:function(a){return this.exec(/^\d\d/,a)},D:function(a){return this.exec(/^\d\d?/,a)},HH:function(a){return this.exec(/^\d\d/,a)},H:function(a){return this.exec(/^\d\d?/,a)},A:function(a){return this.find(this.res.A,a)},hh:function(a){return this.exec(/^\d\d/,a)},h:function(a){return this.exec(/^\d\d?/,
|
|
9
9
|
a)},mm:function(a){return this.exec(/^\d\d/,a)},m:function(a){return this.exec(/^\d\d?/,a)},ss:function(a){return this.exec(/^\d\d/,a)},s:function(a){return this.exec(/^\d\d?/,a)},SSS:function(a){return this.exec(/^\d{1,3}/,a)},SS:function(a){a=this.exec(/^\d\d?/,a);a.value*=10;return a},S:function(a){a=this.exec(/^\d/,a);a.value*=100;return a},Z:function(a){a=this.exec(/^[\+-]\d{2}[0-5]\d/,a);a.value=-60*(a.value/100|0)-a.value%100;return a},h12:function(a,b){return(12===a?0:a)+12*b},exec:function(a,
|
|
10
|
-
b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,
|
|
11
|
-
format
|
|
12
|
-
|
|
13
|
-
a.m,a.s,a.S)):new Date(NaN)}
|
|
14
|
-
new Date(a.getTime());a.setMonth(a.getMonth()+b);return a}
|
|
15
|
-
1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}}
|
|
16
|
-
a;
|
|
10
|
+
b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,h=0,g=a.length,l;h<g;h++)l=a[h],!b.indexOf(l)&&l.length>d&&(c=h,d=l.length);return{value:c,length:d}},pre:function(a){return a},res:t},n=function(a,b,c,d){var h={},g;for(g in a)h[g]=a[g];for(g in b||{})!!c^!!h[g]||(h[g]=b[g]);d&&(h.res=d);return h},f={_formatter:w,_parser:x};f.compile=function(a){for(var b=/\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g,c,d=[a];c=b.exec(a);)d[d.length]=c[0];return d};
|
|
11
|
+
f.format=function(a,b,c){var d=this||e;b="string"===typeof b?d.compile(b):b;var h=a.getTimezoneOffset();a=d.addMinutes(a,c?h:0);d=d._formatter;var g="";a.getTimezoneOffset=function(){return c?0:h};for(var l=1,u=b.length,k;l<u;l++)k=b[l],g+=d[k]?d.post(d[k](a,b[0])):k.replace(/\[(.*)]/,"$1");return g};f.preparse=function(a,b){var c=this||e;b="string"===typeof b?c.compile(b):b;var d={Y:1970,M:1,D:1,H:0,A:0,h:0,m:0,s:0,S:0,Z:0,_index:0,_length:0,_match:0},h=/\[(.*)]/;c=c._parser;var g=0;a=c.pre(a);for(var l=
|
|
12
|
+
1,u=b.length,k,q;l<u;l++)if(k=b[l],c[k]){q=c[k](a.slice(g),b[0]);if(!q.length)break;g+=q.length;d[q.token||k.charAt(0)]=q.value;d._match++}else if(k===a.charAt(g)||" "===k)g++;else if(h.test(k)&&!a.slice(g).indexOf(h.exec(k)[1]))g+=k.length-2;else{"..."===k&&(g=a.length);break}d.H=d.H||c.h12(d.h,d.A);d._index=g;d._length=a.length;return d};f.parse=function(a,b,c){var d=this||e;a=d.preparse(a,b);return d.isValid(a)?(a.M-=100>a.Y?22801:1,c||a.Z?new Date(Date.UTC(a.Y,a.M,a.D,a.H,a.m+a.Z,a.s,a.S)):new Date(a.Y,
|
|
13
|
+
a.M,a.D,a.H,a.m,a.s,a.S)):new Date(NaN)};f.isValid=function(a,b){var c=this||e;a="string"===typeof a?c.preparse(a,b):a;c=[31,28+c.isLeapYear(a.Y)|0,31,30,31,30,31,31,30,31,30,31][a.M-1];return!(1>a._index||1>a._length||a._index-a._length||1>a._match||1>a.Y||9999<a.Y||1>a.M||12<a.M||1>a.D||a.D>c||0>a.H||23<a.H||0>a.m||59<a.m||0>a.s||59<a.s||0>a.S||999<a.S||-720>a.Z||840<a.Z)};f.transform=function(a,b,c,d){let h=this||e;return h.format(h.parse(a,b),c,d)};f.addYears=function(a,b){return(this||e).addMonths(a,
|
|
14
|
+
12*b)};f.addMonths=function(a,b){a=new Date(a.getTime());a.setMonth(a.getMonth()+b);return a};f.addDays=function(a,b){a=new Date(a.getTime());a.setDate(a.getDate()+b);return a};f.addHours=function(a,b){return(this||e).addMinutes(a,60*b)};f.addMinutes=function(a,b){return(this||e).addSeconds(a,60*b)};f.addSeconds=function(a,b){return(this||e).addMilliseconds(a,1E3*b)};f.addMilliseconds=function(a,b){return new Date(a.getTime()+b)};f.subtract=function(a,b){var c=a.getTime()-b.getTime();return{toMilliseconds:function(){return c},
|
|
15
|
+
toSeconds:function(){return c/1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}};f.isLeapYear=function(a){return!(a%4)&&!!(a%100)||!(a%400)};f.isSameDay=function(a,b){return a.toDateString()===b.toDateString()};f.locale=function(a,b){p[a]||(p[a]=b)};f.plugin=function(a,b){m[a]||(m[a]=b)};var v=n(f);var e=n(f);e.locale=function(a){a="function"===typeof a?a:e.locale[a];if(!a)return r;r=a(f);var b=p[r]||{},c=n(t,b.res,!0);a=n(w,b.formatter,!0,
|
|
16
|
+
c);b=n(x,b.parser,!0,c);e._formatter=v._formatter=a;e._parser=v._parser=b;for(var d in m)e.extend(m[d]);return r};e.extend=function(a){var b=n(e._parser.res,a.res),c=a.extender||{};e._formatter=n(e._formatter,a.formatter,!1,b);e._parser=n(e._parser,a.parser,!1,b);for(var d in c)e[d]||(e[d]=c[d])};e.plugin=function(a){(a="function"===typeof a?a:e.plugin[a])&&e.extend(m[a(f,v)]||{})};return e})
|
package/esm/date-and-time.es.js
CHANGED
|
@@ -122,12 +122,13 @@ var locales = {},
|
|
|
122
122
|
obj.res = res;
|
|
123
123
|
}
|
|
124
124
|
return obj;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
},
|
|
126
|
+
proto = {
|
|
127
|
+
_formatter: _formatter,
|
|
128
|
+
_parser: _parser
|
|
129
|
+
},
|
|
130
|
+
localized_proto,
|
|
131
|
+
date;
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* Compiling a format string
|
|
@@ -151,10 +152,10 @@ proto.compile = function (formatString) {
|
|
|
151
152
|
* @returns {string} a formatted string
|
|
152
153
|
*/
|
|
153
154
|
proto.format = function (dateObj, arg, utc) {
|
|
154
|
-
var pattern = typeof arg === 'string' ?
|
|
155
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
155
156
|
offset = dateObj.getTimezoneOffset(),
|
|
156
|
-
d =
|
|
157
|
-
formatter =
|
|
157
|
+
d = ctx.addMinutes(dateObj, utc ? offset : 0),
|
|
158
|
+
formatter = ctx._formatter, str = '';
|
|
158
159
|
|
|
159
160
|
d.getTimezoneOffset = function () { return utc ? 0 : offset; };
|
|
160
161
|
for (var i = 1, len = pattern.length, token; i < len; i++) {
|
|
@@ -171,9 +172,9 @@ proto.format = function (dateObj, arg, utc) {
|
|
|
171
172
|
* @returns {Object} a date structure
|
|
172
173
|
*/
|
|
173
174
|
proto.preparse = function (dateString, arg) {
|
|
174
|
-
var pattern = typeof arg === 'string' ?
|
|
175
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
175
176
|
dt = { Y: 1970, M: 1, D: 1, H: 0, A: 0, h: 0, m: 0, s: 0, S: 0, Z: 0, _index: 0, _length: 0, _match: 0 },
|
|
176
|
-
comment = /\[(.*)]/, parser =
|
|
177
|
+
comment = /\[(.*)]/, parser = ctx._parser, offset = 0;
|
|
177
178
|
|
|
178
179
|
dateString = parser.pre(dateString);
|
|
179
180
|
for (var i = 1, len = pattern.length, token, result; i < len; i++) {
|
|
@@ -211,9 +212,9 @@ proto.preparse = function (dateString, arg) {
|
|
|
211
212
|
* @returns {Date} a constructed date
|
|
212
213
|
*/
|
|
213
214
|
proto.parse = function (dateString, arg, utc) {
|
|
214
|
-
var dt =
|
|
215
|
+
var ctx = this || date, dt = ctx.preparse(dateString, arg);
|
|
215
216
|
|
|
216
|
-
if (
|
|
217
|
+
if (ctx.isValid(dt)) {
|
|
217
218
|
dt.M -= dt.Y < 100 ? 22801 : 1; // 22801 = 1900 * 12 + 1
|
|
218
219
|
if (utc || dt.Z) {
|
|
219
220
|
return new Date(Date.UTC(dt.Y, dt.M, dt.D, dt.H, dt.m + dt.Z, dt.s, dt.S));
|
|
@@ -230,8 +231,8 @@ proto.parse = function (dateString, arg, utc) {
|
|
|
230
231
|
* @returns {boolean} whether the date string is a valid date
|
|
231
232
|
*/
|
|
232
233
|
proto.isValid = function (arg1, arg2) {
|
|
233
|
-
var dt = typeof arg1 === 'string' ?
|
|
234
|
-
last = [31, 28 +
|
|
234
|
+
var ctx = this || date, dt = typeof arg1 === 'string' ? ctx.preparse(arg1, arg2) : arg1,
|
|
235
|
+
last = [31, 28 + ctx.isLeapYear(dt.Y) | 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][dt.M - 1];
|
|
235
236
|
|
|
236
237
|
return !(
|
|
237
238
|
dt._index < 1 || dt._length < 1 || dt._index - dt._length || dt._match < 1 ||
|
|
@@ -250,7 +251,8 @@ proto.isValid = function (arg1, arg2) {
|
|
|
250
251
|
* @returns {string} a formatted string
|
|
251
252
|
*/
|
|
252
253
|
proto.transform = function (dateString, arg1, arg2, utc) {
|
|
253
|
-
|
|
254
|
+
const ctx = this || date;
|
|
255
|
+
return ctx.format(ctx.parse(dateString, arg1), arg2, utc);
|
|
254
256
|
};
|
|
255
257
|
|
|
256
258
|
/**
|
|
@@ -260,7 +262,7 @@ proto.transform = function (dateString, arg1, arg2, utc) {
|
|
|
260
262
|
* @returns {Date} a date after adding the value
|
|
261
263
|
*/
|
|
262
264
|
proto.addYears = function (dateObj, years) {
|
|
263
|
-
return this.addMonths(dateObj, years * 12);
|
|
265
|
+
return (this || date).addMonths(dateObj, years * 12);
|
|
264
266
|
};
|
|
265
267
|
|
|
266
268
|
/**
|
|
@@ -296,7 +298,7 @@ proto.addDays = function (dateObj, days) {
|
|
|
296
298
|
* @returns {Date} a date after adding the value
|
|
297
299
|
*/
|
|
298
300
|
proto.addHours = function (dateObj, hours) {
|
|
299
|
-
return this.addMinutes(dateObj, hours * 60);
|
|
301
|
+
return (this || date).addMinutes(dateObj, hours * 60);
|
|
300
302
|
};
|
|
301
303
|
|
|
302
304
|
/**
|
|
@@ -306,7 +308,7 @@ proto.addHours = function (dateObj, hours) {
|
|
|
306
308
|
* @returns {Date} a date after adding the value
|
|
307
309
|
*/
|
|
308
310
|
proto.addMinutes = function (dateObj, minutes) {
|
|
309
|
-
return this.addSeconds(dateObj, minutes * 60);
|
|
311
|
+
return (this || date).addSeconds(dateObj, minutes * 60);
|
|
310
312
|
};
|
|
311
313
|
|
|
312
314
|
/**
|
|
@@ -316,7 +318,7 @@ proto.addMinutes = function (dateObj, minutes) {
|
|
|
316
318
|
* @returns {Date} a date after adding the value
|
|
317
319
|
*/
|
|
318
320
|
proto.addSeconds = function (dateObj, seconds) {
|
|
319
|
-
return this.addMilliseconds(dateObj, seconds * 1000);
|
|
321
|
+
return (this || date).addMilliseconds(dateObj, seconds * 1000);
|
|
320
322
|
};
|
|
321
323
|
|
|
322
324
|
/**
|
|
@@ -400,8 +402,8 @@ proto.plugin = function (name, plugin) {
|
|
|
400
402
|
}
|
|
401
403
|
};
|
|
402
404
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
+
localized_proto = extend(proto);
|
|
406
|
+
date = extend(proto);
|
|
405
407
|
|
|
406
408
|
/**
|
|
407
409
|
* Changing locale
|
|
@@ -463,4 +465,6 @@ date.plugin = function (plugin) {
|
|
|
463
465
|
}
|
|
464
466
|
};
|
|
465
467
|
|
|
466
|
-
|
|
468
|
+
var date$1 = date;
|
|
469
|
+
|
|
470
|
+
export { date$1 as default };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/*
|
|
2
2
|
date-and-time (c) KNOWLEDGECODE | MIT
|
|
3
3
|
*/
|
|
4
|
-
var
|
|
4
|
+
var e={},f={},m="en",n={MMMM:"January February March April May June July August September October November December".split(" "),MMM:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dddd:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ddd:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dd:"Su Mo Tu We Th Fr Sa".split(" "),A:["AM","PM"]},q={YYYY:function(a){return("000"+a.getFullYear()).slice(-4)},YY:function(a){return("0"+a.getFullYear()).slice(-2)},Y:function(a){return""+
|
|
5
5
|
a.getFullYear()},MMMM:function(a){return this.res.MMMM[a.getMonth()]},MMM:function(a){return this.res.MMM[a.getMonth()]},MM:function(a){return("0"+(a.getMonth()+1)).slice(-2)},M:function(a){return""+(a.getMonth()+1)},DD:function(a){return("0"+a.getDate()).slice(-2)},D:function(a){return""+a.getDate()},HH:function(a){return("0"+a.getHours()).slice(-2)},H:function(a){return""+a.getHours()},A:function(a){return this.res.A[11<a.getHours()|0]},hh:function(a){return("0"+(a.getHours()%12||12)).slice(-2)},
|
|
6
6
|
h:function(a){return""+(a.getHours()%12||12)},mm:function(a){return("0"+a.getMinutes()).slice(-2)},m:function(a){return""+a.getMinutes()},ss:function(a){return("0"+a.getSeconds()).slice(-2)},s:function(a){return""+a.getSeconds()},SSS:function(a){return("00"+a.getMilliseconds()).slice(-3)},SS:function(a){return("0"+(a.getMilliseconds()/10|0)).slice(-2)},S:function(a){return""+(a.getMilliseconds()/100|0)},dddd:function(a){return this.res.dddd[a.getDay()]},ddd:function(a){return this.res.ddd[a.getDay()]},
|
|
7
|
-
dd:function(a){return this.res.dd[a.getDay()]},Z:function(a){a=a.getTimezoneOffset()/.6|0;return(0<a?"-":"+")+("000"+Math.abs(a-(a%100*.4|0))).slice(-4)},post:function(a){return a},res:
|
|
7
|
+
dd:function(a){return this.res.dd[a.getDay()]},Z:function(a){a=a.getTimezoneOffset()/.6|0;return(0<a?"-":"+")+("000"+Math.abs(a-(a%100*.4|0))).slice(-4)},post:function(a){return a},res:n},r={YYYY:function(a){return this.exec(/^\d{4}/,a)},Y:function(a){return this.exec(/^\d{1,4}/,a)},MMMM:function(a){a=this.find(this.res.MMMM,a);a.value++;return a},MMM:function(a){a=this.find(this.res.MMM,a);a.value++;return a},MM:function(a){return this.exec(/^\d\d/,a)},M:function(a){return this.exec(/^\d\d?/,a)},
|
|
8
8
|
DD:function(a){return this.exec(/^\d\d/,a)},D:function(a){return this.exec(/^\d\d?/,a)},HH:function(a){return this.exec(/^\d\d/,a)},H:function(a){return this.exec(/^\d\d?/,a)},A:function(a){return this.find(this.res.A,a)},hh:function(a){return this.exec(/^\d\d/,a)},h:function(a){return this.exec(/^\d\d?/,a)},mm:function(a){return this.exec(/^\d\d/,a)},m:function(a){return this.exec(/^\d\d?/,a)},ss:function(a){return this.exec(/^\d\d/,a)},s:function(a){return this.exec(/^\d\d?/,a)},SSS:function(a){return this.exec(/^\d{1,3}/,
|
|
9
|
-
a)},SS:function(a){a=this.exec(/^\d\d?/,a);a.value*=10;return a},S:function(a){a=this.exec(/^\d/,a);a.value*=100;return a},Z:function(a){a=this.exec(/^[\+-]\d{2}[0-5]\d/,a);a.value=-60*(a.value/100|0)-a.value%100;return a},h12:function(a,b){return(12===a?0:a)+12*b},exec:function(a,b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,
|
|
10
|
-
res:
|
|
11
|
-
|
|
12
|
-
b
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
x.
|
|
9
|
+
a)},SS:function(a){a=this.exec(/^\d\d?/,a);a.value*=10;return a},S:function(a){a=this.exec(/^\d/,a);a.value*=100;return a},Z:function(a){a=this.exec(/^[\+-]\d{2}[0-5]\d/,a);a.value=-60*(a.value/100|0)-a.value%100;return a},h12:function(a,b){return(12===a?0:a)+12*b},exec:function(a,b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,h=0,g=a.length,l;h<g;h++)l=a[h],!b.indexOf(l)&&l.length>d&&(c=h,d=l.length);return{value:c,length:d}},pre:function(a){return a},
|
|
10
|
+
res:n};function t(a,b,c,d){var h={},g;for(g in a)h[g]=a[g];for(g in b||{})!!c^!!h[g]||(h[g]=b[g]);d&&(h.res=d);return h}var u={_formatter:q,_parser:r},w,x;u.compile=function(a){for(var b=/\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g,c,d=[a];c=b.exec(a);)d[d.length]=c[0];return d};
|
|
11
|
+
u.format=function(a,b,c){var d=this||x;b="string"===typeof b?d.compile(b):b;var h=a.getTimezoneOffset();a=d.addMinutes(a,c?h:0);d=d._formatter;var g="";a.getTimezoneOffset=function(){return c?0:h};for(var l=1,v=b.length,k;l<v;l++)k=b[l],g+=d[k]?d.post(d[k](a,b[0])):k.replace(/\[(.*)]/,"$1");return g};
|
|
12
|
+
u.preparse=function(a,b){var c=this||x;b="string"===typeof b?c.compile(b):b;var d={Y:1970,M:1,D:1,H:0,A:0,h:0,m:0,s:0,S:0,Z:0,_index:0,_length:0,_match:0},h=/\[(.*)]/;c=c._parser;var g=0;a=c.pre(a);for(var l=1,v=b.length,k,p;l<v;l++)if(k=b[l],c[k]){p=c[k](a.slice(g),b[0]);if(!p.length)break;g+=p.length;d[p.token||k.charAt(0)]=p.value;d._match++}else if(k===a.charAt(g)||" "===k)g++;else if(h.test(k)&&!a.slice(g).indexOf(h.exec(k)[1]))g+=k.length-2;else{"..."===k&&(g=a.length);break}d.H=d.H||c.h12(d.h,
|
|
13
|
+
d.A);d._index=g;d._length=a.length;return d};u.parse=function(a,b,c){var d=this||x;a=d.preparse(a,b);return d.isValid(a)?(a.M-=100>a.Y?22801:1,c||a.Z?new Date(Date.UTC(a.Y,a.M,a.D,a.H,a.m+a.Z,a.s,a.S)):new Date(a.Y,a.M,a.D,a.H,a.m,a.s,a.S)):new Date(NaN)};
|
|
14
|
+
u.isValid=function(a,b){var c=this||x;a="string"===typeof a?c.preparse(a,b):a;c=[31,28+c.isLeapYear(a.Y)|0,31,30,31,30,31,31,30,31,30,31][a.M-1];return!(1>a._index||1>a._length||a._index-a._length||1>a._match||1>a.Y||9999<a.Y||1>a.M||12<a.M||1>a.D||a.D>c||0>a.H||23<a.H||0>a.m||59<a.m||0>a.s||59<a.s||0>a.S||999<a.S||-720>a.Z||840<a.Z)};u.transform=function(a,b,c,d){let h=this||x;return h.format(h.parse(a,b),c,d)};u.addYears=function(a,b){return(this||x).addMonths(a,12*b)};
|
|
15
|
+
u.addMonths=function(a,b){a=new Date(a.getTime());a.setMonth(a.getMonth()+b);return a};u.addDays=function(a,b){a=new Date(a.getTime());a.setDate(a.getDate()+b);return a};u.addHours=function(a,b){return(this||x).addMinutes(a,60*b)};u.addMinutes=function(a,b){return(this||x).addSeconds(a,60*b)};u.addSeconds=function(a,b){return(this||x).addMilliseconds(a,1E3*b)};u.addMilliseconds=function(a,b){return new Date(a.getTime()+b)};
|
|
16
|
+
u.subtract=function(a,b){var c=a.getTime()-b.getTime();return{toMilliseconds:function(){return c},toSeconds:function(){return c/1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}};u.isLeapYear=function(a){return!(a%4)&&!!(a%100)||!(a%400)};u.isSameDay=function(a,b){return a.toDateString()===b.toDateString()};u.locale=function(a,b){e[a]||(e[a]=b)};u.plugin=function(a,b){f[a]||(f[a]=b)};w=t(u);x=t(u);
|
|
17
|
+
x.locale=function(a){a="function"===typeof a?a:x.locale[a];if(!a)return m;m=a(u);var b=e[m]||{},c=t(n,b.res,!0);a=t(q,b.formatter,!0,c);b=t(r,b.parser,!0,c);x._formatter=w._formatter=a;x._parser=w._parser=b;for(var d in f)x.extend(f[d]);return m};x.extend=function(a){var b=t(x._parser.res,a.res),c=a.extender||{};x._formatter=t(x._formatter,a.formatter,!1,b);x._parser=t(x._parser,a.parser,!1,b);for(var d in c)x[d]||(x[d]=c[d])};
|
|
18
|
+
x.plugin=function(a){(a="function"===typeof a?a:x.plugin[a])&&x.extend(f[a(u,w)]||{})};export default x
|
package/esm/date-and-time.mjs
CHANGED
|
@@ -122,12 +122,13 @@ var locales = {},
|
|
|
122
122
|
obj.res = res;
|
|
123
123
|
}
|
|
124
124
|
return obj;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
},
|
|
126
|
+
proto = {
|
|
127
|
+
_formatter: _formatter,
|
|
128
|
+
_parser: _parser
|
|
129
|
+
},
|
|
130
|
+
localized_proto,
|
|
131
|
+
date;
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* Compiling a format string
|
|
@@ -151,10 +152,10 @@ proto.compile = function (formatString) {
|
|
|
151
152
|
* @returns {string} a formatted string
|
|
152
153
|
*/
|
|
153
154
|
proto.format = function (dateObj, arg, utc) {
|
|
154
|
-
var pattern = typeof arg === 'string' ?
|
|
155
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
155
156
|
offset = dateObj.getTimezoneOffset(),
|
|
156
|
-
d =
|
|
157
|
-
formatter =
|
|
157
|
+
d = ctx.addMinutes(dateObj, utc ? offset : 0),
|
|
158
|
+
formatter = ctx._formatter, str = '';
|
|
158
159
|
|
|
159
160
|
d.getTimezoneOffset = function () { return utc ? 0 : offset; };
|
|
160
161
|
for (var i = 1, len = pattern.length, token; i < len; i++) {
|
|
@@ -171,9 +172,9 @@ proto.format = function (dateObj, arg, utc) {
|
|
|
171
172
|
* @returns {Object} a date structure
|
|
172
173
|
*/
|
|
173
174
|
proto.preparse = function (dateString, arg) {
|
|
174
|
-
var pattern = typeof arg === 'string' ?
|
|
175
|
+
var ctx = this || date, pattern = typeof arg === 'string' ? ctx.compile(arg) : arg,
|
|
175
176
|
dt = { Y: 1970, M: 1, D: 1, H: 0, A: 0, h: 0, m: 0, s: 0, S: 0, Z: 0, _index: 0, _length: 0, _match: 0 },
|
|
176
|
-
comment = /\[(.*)]/, parser =
|
|
177
|
+
comment = /\[(.*)]/, parser = ctx._parser, offset = 0;
|
|
177
178
|
|
|
178
179
|
dateString = parser.pre(dateString);
|
|
179
180
|
for (var i = 1, len = pattern.length, token, result; i < len; i++) {
|
|
@@ -211,9 +212,9 @@ proto.preparse = function (dateString, arg) {
|
|
|
211
212
|
* @returns {Date} a constructed date
|
|
212
213
|
*/
|
|
213
214
|
proto.parse = function (dateString, arg, utc) {
|
|
214
|
-
var dt =
|
|
215
|
+
var ctx = this || date, dt = ctx.preparse(dateString, arg);
|
|
215
216
|
|
|
216
|
-
if (
|
|
217
|
+
if (ctx.isValid(dt)) {
|
|
217
218
|
dt.M -= dt.Y < 100 ? 22801 : 1; // 22801 = 1900 * 12 + 1
|
|
218
219
|
if (utc || dt.Z) {
|
|
219
220
|
return new Date(Date.UTC(dt.Y, dt.M, dt.D, dt.H, dt.m + dt.Z, dt.s, dt.S));
|
|
@@ -230,8 +231,8 @@ proto.parse = function (dateString, arg, utc) {
|
|
|
230
231
|
* @returns {boolean} whether the date string is a valid date
|
|
231
232
|
*/
|
|
232
233
|
proto.isValid = function (arg1, arg2) {
|
|
233
|
-
var dt = typeof arg1 === 'string' ?
|
|
234
|
-
last = [31, 28 +
|
|
234
|
+
var ctx = this || date, dt = typeof arg1 === 'string' ? ctx.preparse(arg1, arg2) : arg1,
|
|
235
|
+
last = [31, 28 + ctx.isLeapYear(dt.Y) | 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][dt.M - 1];
|
|
235
236
|
|
|
236
237
|
return !(
|
|
237
238
|
dt._index < 1 || dt._length < 1 || dt._index - dt._length || dt._match < 1 ||
|
|
@@ -250,7 +251,8 @@ proto.isValid = function (arg1, arg2) {
|
|
|
250
251
|
* @returns {string} a formatted string
|
|
251
252
|
*/
|
|
252
253
|
proto.transform = function (dateString, arg1, arg2, utc) {
|
|
253
|
-
|
|
254
|
+
const ctx = this || date;
|
|
255
|
+
return ctx.format(ctx.parse(dateString, arg1), arg2, utc);
|
|
254
256
|
};
|
|
255
257
|
|
|
256
258
|
/**
|
|
@@ -260,7 +262,7 @@ proto.transform = function (dateString, arg1, arg2, utc) {
|
|
|
260
262
|
* @returns {Date} a date after adding the value
|
|
261
263
|
*/
|
|
262
264
|
proto.addYears = function (dateObj, years) {
|
|
263
|
-
return this.addMonths(dateObj, years * 12);
|
|
265
|
+
return (this || date).addMonths(dateObj, years * 12);
|
|
264
266
|
};
|
|
265
267
|
|
|
266
268
|
/**
|
|
@@ -296,7 +298,7 @@ proto.addDays = function (dateObj, days) {
|
|
|
296
298
|
* @returns {Date} a date after adding the value
|
|
297
299
|
*/
|
|
298
300
|
proto.addHours = function (dateObj, hours) {
|
|
299
|
-
return this.addMinutes(dateObj, hours * 60);
|
|
301
|
+
return (this || date).addMinutes(dateObj, hours * 60);
|
|
300
302
|
};
|
|
301
303
|
|
|
302
304
|
/**
|
|
@@ -306,7 +308,7 @@ proto.addHours = function (dateObj, hours) {
|
|
|
306
308
|
* @returns {Date} a date after adding the value
|
|
307
309
|
*/
|
|
308
310
|
proto.addMinutes = function (dateObj, minutes) {
|
|
309
|
-
return this.addSeconds(dateObj, minutes * 60);
|
|
311
|
+
return (this || date).addSeconds(dateObj, minutes * 60);
|
|
310
312
|
};
|
|
311
313
|
|
|
312
314
|
/**
|
|
@@ -316,7 +318,7 @@ proto.addMinutes = function (dateObj, minutes) {
|
|
|
316
318
|
* @returns {Date} a date after adding the value
|
|
317
319
|
*/
|
|
318
320
|
proto.addSeconds = function (dateObj, seconds) {
|
|
319
|
-
return this.addMilliseconds(dateObj, seconds * 1000);
|
|
321
|
+
return (this || date).addMilliseconds(dateObj, seconds * 1000);
|
|
320
322
|
};
|
|
321
323
|
|
|
322
324
|
/**
|
|
@@ -400,8 +402,8 @@ proto.plugin = function (name, plugin) {
|
|
|
400
402
|
}
|
|
401
403
|
};
|
|
402
404
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
+
localized_proto = extend(proto);
|
|
406
|
+
date = extend(proto);
|
|
405
407
|
|
|
406
408
|
/**
|
|
407
409
|
* Changing locale
|
|
@@ -463,4 +465,6 @@ date.plugin = function (plugin) {
|
|
|
463
465
|
}
|
|
464
466
|
};
|
|
465
467
|
|
|
466
|
-
|
|
468
|
+
var date$1 = date;
|
|
469
|
+
|
|
470
|
+
export { date$1 as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @preserve date-and-time.js locale configuration
|
|
3
|
+
* @preserve Swedish (SV)
|
|
4
|
+
* @preserve It is using moment.js locale configuration as a reference.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var sv = function (date) {
|
|
8
|
+
var code = 'sv';
|
|
9
|
+
|
|
10
|
+
date.locale(code, {
|
|
11
|
+
res: {
|
|
12
|
+
MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'],
|
|
13
|
+
MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
|
14
|
+
dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
|
|
15
|
+
ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'],
|
|
16
|
+
dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö']
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return code;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { sv as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @preserve date-and-time.js locale configuration
|
|
3
|
+
* @preserve Swedish (SV)
|
|
4
|
+
* @preserve It is using moment.js locale configuration as a reference.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var sv = function (date) {
|
|
8
|
+
var code = 'sv';
|
|
9
|
+
|
|
10
|
+
date.locale(code, {
|
|
11
|
+
res: {
|
|
12
|
+
MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'],
|
|
13
|
+
MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
|
14
|
+
dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
|
|
15
|
+
ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'],
|
|
16
|
+
dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö']
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return code;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { sv as default };
|
package/locale/sv.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.sv = factory()));
|
|
5
|
+
})(this, (function () { 'use strict';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @preserve date-and-time.js locale configuration
|
|
9
|
+
* @preserve Swedish (SV)
|
|
10
|
+
* @preserve It is using moment.js locale configuration as a reference.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var sv = function (date) {
|
|
14
|
+
var code = 'sv';
|
|
15
|
+
|
|
16
|
+
date.locale(code, {
|
|
17
|
+
res: {
|
|
18
|
+
MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'],
|
|
19
|
+
MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
|
|
20
|
+
dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
|
|
21
|
+
ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'],
|
|
22
|
+
dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö']
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return code;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return sv;
|
|
29
|
+
|
|
30
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "date-and-time",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A Minimalist DateTime utility for Node.js and the browser",
|
|
5
5
|
"main": "date-and-time.js",
|
|
6
6
|
"module": "esm/date-and-time.es.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
|
|
48
48
|
"expect.js": "^0.3.1",
|
|
49
|
-
"mocha": "^9.1.
|
|
49
|
+
"mocha": "^9.1.3",
|
|
50
50
|
"mocha-headless-chrome": "^3.1.0",
|
|
51
|
-
"rollup": "^2.
|
|
51
|
+
"rollup": "^2.63.0"
|
|
52
52
|
}
|
|
53
53
|
}
|