date-and-time 2.0.0 → 2.0.1

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.
Files changed (51) hide show
  1. package/EXTEND.md +4 -0
  2. package/README.md +3 -5
  3. package/date-and-time.js +6 -5
  4. package/date-and-time.min.js +8 -8
  5. package/esm/date-and-time.es.js +4 -3
  6. package/esm/date-and-time.es.min.js +6 -6
  7. package/esm/date-and-time.mjs +4 -3
  8. package/esm/plugin/timezone.es.js +4 -4
  9. package/esm/plugin/timezone.mjs +4 -4
  10. package/locale/ar.js +2 -2
  11. package/locale/az.js +2 -2
  12. package/locale/bn.js +2 -2
  13. package/locale/cs.js +2 -2
  14. package/locale/de.js +2 -2
  15. package/locale/dk.js +2 -2
  16. package/locale/el.js +2 -2
  17. package/locale/en.js +2 -2
  18. package/locale/es.js +2 -2
  19. package/locale/fa.js +2 -2
  20. package/locale/fr.js +2 -2
  21. package/locale/hi.js +2 -2
  22. package/locale/hu.js +2 -2
  23. package/locale/id.js +2 -2
  24. package/locale/it.js +2 -2
  25. package/locale/ja.js +2 -2
  26. package/locale/jv.js +2 -2
  27. package/locale/ko.js +2 -2
  28. package/locale/my.js +2 -2
  29. package/locale/nl.js +2 -2
  30. package/locale/pa-in.js +3 -3
  31. package/locale/pl.js +2 -2
  32. package/locale/pt.js +2 -2
  33. package/locale/ro.js +2 -2
  34. package/locale/ru.js +2 -2
  35. package/locale/rw.js +2 -2
  36. package/locale/sr.js +2 -2
  37. package/locale/th.js +2 -2
  38. package/locale/tr.js +2 -2
  39. package/locale/uk.js +2 -2
  40. package/locale/uz.js +2 -2
  41. package/locale/vi.js +2 -2
  42. package/locale/zh-cn.js +3 -3
  43. package/locale/zh-tw.js +3 -3
  44. package/package.json +3 -3
  45. package/plugin/day-of-week.js +3 -3
  46. package/plugin/meridiem.js +2 -2
  47. package/plugin/microsecond.js +2 -2
  48. package/plugin/ordinal.js +2 -2
  49. package/plugin/timespan.js +2 -2
  50. package/plugin/timezone.js +6 -6
  51. package/plugin/two-digit-year.js +3 -3
package/EXTEND.md CHANGED
@@ -101,3 +101,7 @@ date.extend({
101
101
  ```
102
102
 
103
103
  Extending the parser may be a bit difficult. Refer to the library source code to grasp the default behavior.
104
+
105
+ ## Caveats
106
+
107
+ Note that switching locales or applying plugins after extending the library will be cleared all extensions. In such cases, you need to extend the library again.
package/README.md CHANGED
@@ -24,6 +24,9 @@ npm i date-and-time
24
24
 
25
25
  ## Recent Changes
26
26
 
27
+ - 2.0.1
28
+ - Fixed a bug that the timezone plugin does not support changing locales.
29
+
27
30
  - 2.0.0
28
31
  - Fixed a conflict when importing multiple plugins and locales.
29
32
  - **Breaking Changes!** Due to the above fix, the specifications of plugin, locale, and extension have been changed. The `meridiem` plugin and the `two-digit-year` plugin are now partially incompatible with previous ones. See [here](./PLUGINS.md) for details. Also the `extend()` function has changed. If you are using it, check [here](./EXTEND.md) for any impact. The locales are still compatible.
@@ -32,11 +35,6 @@ npm i date-and-time
32
35
  - 1.0.1
33
36
  - Updated dev dependencies to resolve vulnerability.
34
37
 
35
- - 1.0.0
36
- - **First stable release!**
37
- - ES Modules support.
38
- - Added Kinyarwanda support.
39
-
40
38
  ## Usage
41
39
 
42
40
  - ES Modules:
package/date-and-time.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.date = factory());
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time (c) KNOWLEDGECODE | MIT
@@ -406,6 +406,7 @@
406
406
  }
407
407
  };
408
408
 
409
+ var localized_proto = extend(proto);
409
410
  var date = extend(proto);
410
411
 
411
412
  /**
@@ -426,8 +427,8 @@
426
427
  var formatter = extend(_formatter, extension.formatter, true, res);
427
428
  var parser = extend(_parser, extension.parser, true, res);
428
429
 
429
- date._formatter = formatter;
430
- date._parser = parser;
430
+ date._formatter = localized_proto._formatter = formatter;
431
+ date._parser = localized_proto._parser = parser;
431
432
 
432
433
  for (var plugin in plugins) {
433
434
  date.extend(plugins[plugin]);
@@ -464,10 +465,10 @@
464
465
  var install = typeof plugin === 'function' ? plugin : date.plugin[plugin];
465
466
 
466
467
  if (install) {
467
- date.extend(plugins[install(proto)] || {});
468
+ date.extend(plugins[install(proto, localized_proto)] || {});
468
469
  }
469
470
  };
470
471
 
471
472
  return date;
472
473
 
473
- })));
474
+ }));
@@ -1,16 +1,16 @@
1
1
  /*
2
2
  date-and-time (c) KNOWLEDGECODE | MIT
3
3
  */
4
- 'use strict';(function(m,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l():"function"===typeof define&&define.amd?define(l):(m="undefined"!==typeof globalThis?globalThis:m||self,m.date=l())})(this,function(){var m={},l={},q="en",r={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
- ddd:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dd:"Su Mo Tu We Th Fr Sa".split(" "),A:["AM","PM"]},v={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)},
4
+ 'use strict';(function(n,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l():"function"===typeof define&&define.amd?define(l):(n="undefined"!==typeof globalThis?globalThis:n||self,n.date=l())})(this,function(){var n={},l={},q="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
+ 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
- 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:r},w={YYYY:function(a){return this.exec(/^\d{4}/,a)},Y:function(a){return this.exec(/^\d{1,4}/,a)},
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,f=0,e=a.length,k;f<e;f++)k=a[f],!b.indexOf(k)&&k.length>d&&(c=f,d=k.length);return{value:c,length:d}},pre:function(a){return a},res:r},n=function(a,b,c,d){var f={},e;for(e in a)f[e]=a[e];for(e in b||{})!!c^!!f[e]||(f[e]=b[e]);d&&(f.res=d);return f},u={_formatter:v,_parser:w,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
- format:function(a,b,c){b="string"===typeof b?this.compile(b):b;var d=a.getTimezoneOffset();a=this.addMinutes(a,c?d:0);var f=this._formatter,e="";a.getTimezoneOffset=function(){return c?0:d};for(var k=1,t=b.length,h;k<t;k++)h=b[k],e+=f[h]?f.post(f[h](a,b[0])):h.replace(/\[(.*)]/,"$1");return e},preparse:function(a,b){b="string"===typeof b?this.compile(b):b;var c={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},d=/\[(.*)]/,f=this._parser,e=0;a=f.pre(a);for(var k=1,t=b.length,
12
- h,p;k<t;k++)if(h=b[k],f[h]){p=f[h](a.slice(e),b[0]);if(!p.length)break;e+=p.length;c[p.token||h.charAt(0)]=p.value;c._match++}else if(h===a.charAt(e)||" "===h)e++;else if(d.test(h)&&!a.slice(e).indexOf(d.exec(h)[1]))e+=h.length-2;else{"..."===h&&(e=a.length);break}c.H=c.H||f.h12(c.h,c.A);c._index=e;c._length=a.length;return c},parse:function(a,b,c){a=this.preparse(a,b);return this.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,
10
+ b){a=(a.exec(b)||[""])[0];return{value:a|0,length:a.length}},find:function(a,b){for(var c=-1,d=0,f=0,e=a.length,k;f<e;f++)k=a[f],!b.indexOf(k)&&k.length>d&&(c=f,d=k.length);return{value:c,length:d}},pre:function(a){return a},res:t},m=function(a,b,c,d){var f={},e;for(e in a)f[e]=a[e];for(e in b||{})!!c^!!f[e]||(f[e]=b[e]);d&&(f.res=d);return f},r={_formatter:w,_parser:x,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
+ format:function(a,b,c){b="string"===typeof b?this.compile(b):b;var d=a.getTimezoneOffset();a=this.addMinutes(a,c?d:0);var f=this._formatter,e="";a.getTimezoneOffset=function(){return c?0:d};for(var k=1,u=b.length,h;k<u;k++)h=b[k],e+=f[h]?f.post(f[h](a,b[0])):h.replace(/\[(.*)]/,"$1");return e},preparse:function(a,b){b="string"===typeof b?this.compile(b):b;var c={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},d=/\[(.*)]/,f=this._parser,e=0;a=f.pre(a);for(var k=1,u=b.length,
12
+ h,p;k<u;k++)if(h=b[k],f[h]){p=f[h](a.slice(e),b[0]);if(!p.length)break;e+=p.length;c[p.token||h.charAt(0)]=p.value;c._match++}else if(h===a.charAt(e)||" "===h)e++;else if(d.test(h)&&!a.slice(e).indexOf(d.exec(h)[1]))e+=h.length-2;else{"..."===h&&(e=a.length);break}c.H=c.H||f.h12(c.h,c.A);c._index=e;c._length=a.length;return c},parse:function(a,b,c){a=this.preparse(a,b);return this.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,
13
13
  a.m,a.s,a.S)):new Date(NaN)},isValid:function(a,b){a="string"===typeof a?this.preparse(a,b):a;b=[31,28+this.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>b||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)},transform:function(a,b,c,d){return this.format(this.parse(a,b),c,d)},addYears:function(a,b){return this.addMonths(a,12*b)},addMonths:function(a,b){a=
14
14
  new Date(a.getTime());a.setMonth(a.getMonth()+b);return a},addDays:function(a,b){a=new Date(a.getTime());a.setDate(a.getDate()+b);return a},addHours:function(a,b){return this.addMinutes(a,60*b)},addMinutes:function(a,b){return this.addSeconds(a,60*b)},addSeconds:function(a,b){return this.addMilliseconds(a,1E3*b)},addMilliseconds:function(a,b){return new Date(a.getTime()+b)},subtract:function(a,b){var c=a.getTime()-b.getTime();return{toMilliseconds:function(){return c},toSeconds:function(){return c/
15
- 1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}},isLeapYear:function(a){return!(a%4)&&!!(a%100)||!(a%400)},isSameDay:function(a,b){return a.toDateString()===b.toDateString()},locale:function(a,b){m[a]||(m[a]=b)},plugin:function(a,b){l[a]||(l[a]=b)}},g=n(u);g.locale=function(a){a="function"===typeof a?a:g.locale[a];if(!a)return q;q=a(u);var b=m[q]||{},c=n(r,b.res,!0);a=n(v,b.formatter,!0,c);b=n(w,b.parser,!0,c);g._formatter=a;g._parser=b;
16
- for(var d in l)g.extend(l[d]);return q};g.extend=function(a){var b=n(g._parser.res,a.res),c=a.extender||{};g._formatter=n(g._formatter,a.formatter,!1,b);g._parser=n(g._parser,a.parser,!1,b);for(var d in c)g[d]||(g[d]=c[d])};g.plugin=function(a){(a="function"===typeof a?a:g.plugin[a])&&g.extend(l[a(u)]||{})};return g})
15
+ 1E3},toMinutes:function(){return c/6E4},toHours:function(){return c/36E5},toDays:function(){return c/864E5}}},isLeapYear:function(a){return!(a%4)&&!!(a%100)||!(a%400)},isSameDay:function(a,b){return a.toDateString()===b.toDateString()},locale:function(a,b){n[a]||(n[a]=b)},plugin:function(a,b){l[a]||(l[a]=b)}},v=m(r),g=m(r);g.locale=function(a){a="function"===typeof a?a:g.locale[a];if(!a)return q;q=a(r);var b=n[q]||{},c=m(t,b.res,!0);a=m(w,b.formatter,!0,c);b=m(x,b.parser,!0,c);g._formatter=v._formatter=
16
+ a;g._parser=v._parser=b;for(var d in l)g.extend(l[d]);return q};g.extend=function(a){var b=m(g._parser.res,a.res),c=a.extender||{};g._formatter=m(g._formatter,a.formatter,!1,b);g._parser=m(g._parser,a.parser,!1,b);for(var d in c)g[d]||(g[d]=c[d])};g.plugin=function(a){(a="function"===typeof a?a:g.plugin[a])&&g.extend(l[a(r,v)]||{})};return g})
@@ -400,6 +400,7 @@ proto.plugin = function (name, plugin) {
400
400
  }
401
401
  };
402
402
 
403
+ var localized_proto = extend(proto);
403
404
  var date = extend(proto);
404
405
 
405
406
  /**
@@ -420,8 +421,8 @@ date.locale = function (locale) {
420
421
  var formatter = extend(_formatter, extension.formatter, true, res);
421
422
  var parser = extend(_parser, extension.parser, true, res);
422
423
 
423
- date._formatter = formatter;
424
- date._parser = parser;
424
+ date._formatter = localized_proto._formatter = formatter;
425
+ date._parser = localized_proto._parser = parser;
425
426
 
426
427
  for (var plugin in plugins) {
427
428
  date.extend(plugins[plugin]);
@@ -458,7 +459,7 @@ date.plugin = function (plugin) {
458
459
  var install = typeof plugin === 'function' ? plugin : date.plugin[plugin];
459
460
 
460
461
  if (install) {
461
- date.extend(plugins[install(proto)] || {});
462
+ date.extend(plugins[install(proto, localized_proto)] || {});
462
463
  }
463
464
  };
464
465
 
@@ -7,11 +7,11 @@ h:function(a){return""+(a.getHours()%12||12)},mm:function(a){return("0"+a.getMin
7
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:p},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
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,f=0,e=a.length,k;f<e;f++)k=a[f],!b.indexOf(k)&&k.length>d&&(c=f,d=k.length);return{value:c,length:d}},pre:function(a){return a},
10
- res:p};function u(a,b,c,d){var f={},e;for(e in a)f[e]=a[e];for(e in b||{})!!c^!!f[e]||(f[e]=b[e]);d&&(f.res=d);return f}
11
- var v={_formatter:q,_parser:r,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},format:function(a,b,c){b="string"===typeof b?this.compile(b):b;var d=a.getTimezoneOffset();a=this.addMinutes(a,c?d:0);var f=this._formatter,e="";a.getTimezoneOffset=function(){return c?0:d};for(var k=1,t=b.length,h;k<t;k++)h=b[k],e+=f[h]?f.post(f[h](a,b[0])):h.replace(/\[(.*)]/,"$1");return e},preparse:function(a,b){b="string"===typeof b?this.compile(b):
12
- b;var c={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},d=/\[(.*)]/,f=this._parser,e=0;a=f.pre(a);for(var k=1,t=b.length,h,n;k<t;k++)if(h=b[k],f[h]){n=f[h](a.slice(e),b[0]);if(!n.length)break;e+=n.length;c[n.token||h.charAt(0)]=n.value;c._match++}else if(h===a.charAt(e)||" "===h)e++;else if(d.test(h)&&!a.slice(e).indexOf(d.exec(h)[1]))e+=h.length-2;else{"..."===h&&(e=a.length);break}c.H=c.H||f.h12(c.h,c.A);c._index=e;c._length=a.length;return c},parse:function(a,b,c){a=this.preparse(a,
10
+ res:p};function t(a,b,c,d){var f={},e;for(e in a)f[e]=a[e];for(e in b||{})!!c^!!f[e]||(f[e]=b[e]);d&&(f.res=d);return f}
11
+ var v={_formatter:q,_parser:r,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},format:function(a,b,c){b="string"===typeof b?this.compile(b):b;var d=a.getTimezoneOffset();a=this.addMinutes(a,c?d:0);var f=this._formatter,e="";a.getTimezoneOffset=function(){return c?0:d};for(var k=1,u=b.length,h;k<u;k++)h=b[k],e+=f[h]?f.post(f[h](a,b[0])):h.replace(/\[(.*)]/,"$1");return e},preparse:function(a,b){b="string"===typeof b?this.compile(b):
12
+ b;var c={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},d=/\[(.*)]/,f=this._parser,e=0;a=f.pre(a);for(var k=1,u=b.length,h,n;k<u;k++)if(h=b[k],f[h]){n=f[h](a.slice(e),b[0]);if(!n.length)break;e+=n.length;c[n.token||h.charAt(0)]=n.value;c._match++}else if(h===a.charAt(e)||" "===h)e++;else if(d.test(h)&&!a.slice(e).indexOf(d.exec(h)[1]))e+=h.length-2;else{"..."===h&&(e=a.length);break}c.H=c.H||f.h12(c.h,c.A);c._index=e;c._length=a.length;return c},parse:function(a,b,c){a=this.preparse(a,
13
13
  b);return this.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)},isValid:function(a,b){a="string"===typeof a?this.preparse(a,b):a;b=[31,28+this.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>b||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)},transform:function(a,
14
14
  b,c,d){return this.format(this.parse(a,b),c,d)},addYears:function(a,b){return this.addMonths(a,12*b)},addMonths:function(a,b){a=new Date(a.getTime());a.setMonth(a.getMonth()+b);return a},addDays:function(a,b){a=new Date(a.getTime());a.setDate(a.getDate()+b);return a},addHours:function(a,b){return this.addMinutes(a,60*b)},addMinutes:function(a,b){return this.addSeconds(a,60*b)},addSeconds:function(a,b){return this.addMilliseconds(a,1E3*b)},addMilliseconds:function(a,b){return new Date(a.getTime()+
15
- b)},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}}},isLeapYear:function(a){return!(a%4)&&!!(a%100)||!(a%400)},isSameDay:function(a,b){return a.toDateString()===b.toDateString()},locale:function(a,b){g[a]||(g[a]=b)},plugin:function(a,b){l[a]||(l[a]=b)}},w=u(v);
16
- w.locale=function(a){a="function"===typeof a?a:w.locale[a];if(!a)return m;m=a(v);var b=g[m]||{},c=u(p,b.res,!0);a=u(q,b.formatter,!0,c);b=u(r,b.parser,!0,c);w._formatter=a;w._parser=b;for(var d in l)w.extend(l[d]);return m};w.extend=function(a){var b=u(w._parser.res,a.res),c=a.extender||{};w._formatter=u(w._formatter,a.formatter,!1,b);w._parser=u(w._parser,a.parser,!1,b);for(var d in c)w[d]||(w[d]=c[d])};w.plugin=function(a){(a="function"===typeof a?a:w.plugin[a])&&w.extend(l[a(v)]||{})};
17
- export default w
15
+ b)},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}}},isLeapYear:function(a){return!(a%4)&&!!(a%100)||!(a%400)},isSameDay:function(a,b){return a.toDateString()===b.toDateString()},locale:function(a,b){g[a]||(g[a]=b)},plugin:function(a,b){l[a]||(l[a]=b)}},w=t(v),x=t(v);
16
+ x.locale=function(a){a="function"===typeof a?a:x.locale[a];if(!a)return m;m=a(v);var b=g[m]||{},c=t(p,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 l)x.extend(l[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])};
17
+ x.plugin=function(a){(a="function"===typeof a?a:x.plugin[a])&&x.extend(l[a(v,w)]||{})};export default x
@@ -400,6 +400,7 @@ proto.plugin = function (name, plugin) {
400
400
  }
401
401
  };
402
402
 
403
+ var localized_proto = extend(proto);
403
404
  var date = extend(proto);
404
405
 
405
406
  /**
@@ -420,8 +421,8 @@ date.locale = function (locale) {
420
421
  var formatter = extend(_formatter, extension.formatter, true, res);
421
422
  var parser = extend(_parser, extension.parser, true, res);
422
423
 
423
- date._formatter = formatter;
424
- date._parser = parser;
424
+ date._formatter = localized_proto._formatter = formatter;
425
+ date._parser = localized_proto._parser = parser;
425
426
 
426
427
  for (var plugin in plugins) {
427
428
  date.extend(plugins[plugin]);
@@ -458,7 +459,7 @@ date.plugin = function (plugin) {
458
459
  var install = typeof plugin === 'function' ? plugin : date.plugin[plugin];
459
460
 
460
461
  if (install) {
461
- date.extend(plugins[install(proto)] || {});
462
+ date.extend(plugins[install(proto, localized_proto)] || {});
462
463
  }
463
464
  };
464
465
 
@@ -3,7 +3,7 @@
3
3
  * @preserve timezone
4
4
  */
5
5
 
6
- var plugin = function (date) {
6
+ var plugin = function (date, localized_date) {
7
7
  var options = {
8
8
  year: 'numeric', month: 'numeric', day: 'numeric',
9
9
  hour: 'numeric', minute: 'numeric', second: 'numeric'
@@ -19,7 +19,7 @@ var plugin = function (date) {
19
19
  var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
20
20
 
21
21
  dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
22
- return date.format(dateObj3, arg);
22
+ return localized_date.format(dateObj3, arg);
23
23
  };
24
24
  var adjustments = [
25
25
  -60, -30, -20,
@@ -28,7 +28,7 @@ var plugin = function (date) {
28
28
  ];
29
29
  var parseTZ = function (dateString, arg, timeZone) {
30
30
  var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
31
- var dateObj = date.parse(dateString, pattern2, true);
31
+ var dateObj = localized_date.parse(dateString, pattern2, true);
32
32
 
33
33
  for (var i = 1, len = pattern2.length; i < len; i++) {
34
34
  if (pattern2[i].indexOf('Z') === 0) {
@@ -43,7 +43,7 @@ var plugin = function (date) {
43
43
  dateObj.getMilliseconds()
44
44
  );
45
45
  var offset = dateObj.getTime() - dateObj2.getTime();
46
- var dateString2 = date.transform(dateString, pattern2, pattern);
46
+ var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
47
47
 
48
48
  var comparer = function (d) {
49
49
  return dateString2 === dateTimeFormat.format(d);
@@ -3,7 +3,7 @@
3
3
  * @preserve timezone
4
4
  */
5
5
 
6
- var plugin = function (date) {
6
+ var plugin = function (date, localized_date) {
7
7
  var options = {
8
8
  year: 'numeric', month: 'numeric', day: 'numeric',
9
9
  hour: 'numeric', minute: 'numeric', second: 'numeric'
@@ -19,7 +19,7 @@ var plugin = function (date) {
19
19
  var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
20
20
 
21
21
  dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
22
- return date.format(dateObj3, arg);
22
+ return localized_date.format(dateObj3, arg);
23
23
  };
24
24
  var adjustments = [
25
25
  -60, -30, -20,
@@ -28,7 +28,7 @@ var plugin = function (date) {
28
28
  ];
29
29
  var parseTZ = function (dateString, arg, timeZone) {
30
30
  var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
31
- var dateObj = date.parse(dateString, pattern2, true);
31
+ var dateObj = localized_date.parse(dateString, pattern2, true);
32
32
 
33
33
  for (var i = 1, len = pattern2.length; i < len; i++) {
34
34
  if (pattern2[i].indexOf('Z') === 0) {
@@ -43,7 +43,7 @@ var plugin = function (date) {
43
43
  dateObj.getMilliseconds()
44
44
  );
45
45
  var offset = dateObj.getTime() - dateObj2.getTime();
46
- var dateString2 = date.transform(dateString, pattern2, pattern);
46
+ var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
47
47
 
48
48
  var comparer = function (d) {
49
49
  return dateString2 === dateTimeFormat.format(d);
package/locale/ar.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ar = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -44,4 +44,4 @@
44
44
 
45
45
  return ar;
46
46
 
47
- })));
47
+ }));
package/locale/az.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.az = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -49,4 +49,4 @@
49
49
 
50
50
  return az;
51
51
 
52
- })));
52
+ }));
package/locale/bn.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.bn = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -55,4 +55,4 @@
55
55
 
56
56
  return bn;
57
57
 
58
- })));
58
+ }));
package/locale/cs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.cs = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return cs;
29
29
 
30
- })));
30
+ }));
package/locale/de.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.de = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return de;
30
30
 
31
- })));
31
+ }));
package/locale/dk.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.dk = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return dk;
29
29
 
30
- })));
30
+ }));
package/locale/el.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.el = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -49,4 +49,4 @@
49
49
 
50
50
  return el;
51
51
 
52
- })));
52
+ }));
package/locale/en.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.en = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -18,4 +18,4 @@
18
18
 
19
19
  return en;
20
20
 
21
- })));
21
+ }));
package/locale/es.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.es = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -47,4 +47,4 @@
47
47
 
48
48
  return es;
49
49
 
50
- })));
50
+ }));
package/locale/fa.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.fa = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -44,4 +44,4 @@
44
44
 
45
45
  return fa;
46
46
 
47
- })));
47
+ }));
package/locale/fr.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.fr = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return fr;
30
30
 
31
- })));
31
+ }));
package/locale/hi.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.hi = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -55,4 +55,4 @@
55
55
 
56
56
  return hi;
57
57
 
58
- })));
58
+ }));
package/locale/hu.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.hu = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return hu;
30
30
 
31
- })));
31
+ }));
package/locale/id.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.id = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -51,4 +51,4 @@
51
51
 
52
52
  return id;
53
53
 
54
- })));
54
+ }));
package/locale/it.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.it = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return it;
30
30
 
31
- })));
31
+ }));
package/locale/ja.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ja = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -36,4 +36,4 @@
36
36
 
37
37
  return ja;
38
38
 
39
- })));
39
+ }));
package/locale/jv.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.jv = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -51,4 +51,4 @@
51
51
 
52
52
  return jv;
53
53
 
54
- })));
54
+ }));
package/locale/ko.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ko = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return ko;
30
30
 
31
- })));
31
+ }));
package/locale/my.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.my = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -43,4 +43,4 @@
43
43
 
44
44
  return my;
45
45
 
46
- })));
46
+ }));
package/locale/nl.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.nl = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -42,4 +42,4 @@
42
42
 
43
43
  return nl;
44
44
 
45
- })));
45
+ }));
package/locale/pa-in.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
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['pa-in'] = factory()));
5
- }(this, (function () { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale["pa-in"] = factory()));
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -67,4 +67,4 @@
67
67
 
68
68
  return pa_in;
69
69
 
70
- })));
70
+ }));
package/locale/pl.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.pl = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -42,4 +42,4 @@
42
42
 
43
43
  return pl;
44
44
 
45
- })));
45
+ }));
package/locale/pt.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.pt = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -49,4 +49,4 @@
49
49
 
50
50
  return pt;
51
51
 
52
- })));
52
+ }));
package/locale/ro.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ro = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return ro;
29
29
 
30
- })));
30
+ }));
package/locale/ru.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ru = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -49,4 +49,4 @@
49
49
 
50
50
  return ru;
51
51
 
52
- })));
52
+ }));
package/locale/rw.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.rw = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return rw;
29
29
 
30
- })));
30
+ }));
package/locale/sr.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.sr = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return sr;
29
29
 
30
- })));
30
+ }));
package/locale/th.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.th = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return th;
30
30
 
31
- })));
31
+ }));
package/locale/tr.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.tr = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return tr;
29
29
 
30
- })));
30
+ }));
package/locale/uk.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.uk = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -62,4 +62,4 @@
62
62
 
63
63
  return uk;
64
64
 
65
- })));
65
+ }));
package/locale/uz.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.uz = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -27,4 +27,4 @@
27
27
 
28
28
  return uz;
29
29
 
30
- })));
30
+ }));
package/locale/vi.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.vi = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -28,4 +28,4 @@
28
28
 
29
29
  return vi;
30
30
 
31
- })));
31
+ }));
package/locale/zh-cn.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
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['zh-cn'] = factory()));
5
- }(this, (function () { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale["zh-cn"] = factory()));
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -53,4 +53,4 @@
53
53
 
54
54
  return zh_cn;
55
55
 
56
- })));
56
+ }));
package/locale/zh-tw.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
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['zh-tw'] = factory()));
5
- }(this, (function () { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale["zh-tw"] = factory()));
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js locale configuration
@@ -51,4 +51,4 @@
51
51
 
52
52
  return zh_tw;
53
53
 
54
- })));
54
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "date-and-time",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
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.0.3",
49
+ "mocha": "^9.1.2",
50
50
  "mocha-headless-chrome": "^3.1.0",
51
- "rollup": "^2.56.2"
51
+ "rollup": "^2.58.0"
52
52
  }
53
53
  }
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin['day-of-week'] = factory()));
5
- }(this, (function () { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin["day-of-week"] = factory()));
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -24,4 +24,4 @@
24
24
 
25
25
  return plugin;
26
26
 
27
- })));
27
+ }));
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.meridiem = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -52,4 +52,4 @@
52
52
 
53
53
  return plugin;
54
54
 
55
- })));
55
+ }));
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.microsecond = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -36,4 +36,4 @@
36
36
 
37
37
  return plugin;
38
38
 
39
- })));
39
+ }));
package/plugin/ordinal.js CHANGED
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.ordinal = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -39,4 +39,4 @@
39
39
 
40
40
  return plugin;
41
41
 
42
- })));
42
+ }));
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.timespan = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -80,4 +80,4 @@
80
80
 
81
81
  return plugin;
82
82
 
83
- })));
83
+ }));
@@ -2,14 +2,14 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.timezone = factory()));
5
- }(this, (function () { 'use strict';
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
9
9
  * @preserve timezone
10
10
  */
11
11
 
12
- var plugin = function (date) {
12
+ var plugin = function (date, localized_date) {
13
13
  var options = {
14
14
  year: 'numeric', month: 'numeric', day: 'numeric',
15
15
  hour: 'numeric', minute: 'numeric', second: 'numeric'
@@ -25,7 +25,7 @@
25
25
  var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
26
26
 
27
27
  dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
28
- return date.format(dateObj3, arg);
28
+ return localized_date.format(dateObj3, arg);
29
29
  };
30
30
  var adjustments = [
31
31
  -60, -30, -20,
@@ -34,7 +34,7 @@
34
34
  ];
35
35
  var parseTZ = function (dateString, arg, timeZone) {
36
36
  var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
37
- var dateObj = date.parse(dateString, pattern2, true);
37
+ var dateObj = localized_date.parse(dateString, pattern2, true);
38
38
 
39
39
  for (var i = 1, len = pattern2.length; i < len; i++) {
40
40
  if (pattern2[i].indexOf('Z') === 0) {
@@ -49,7 +49,7 @@
49
49
  dateObj.getMilliseconds()
50
50
  );
51
51
  var offset = dateObj.getTime() - dateObj2.getTime();
52
- var dateString2 = date.transform(dateString, pattern2, pattern);
52
+ var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
53
53
 
54
54
  var comparer = function (d) {
55
55
  return dateString2 === dateTimeFormat.format(d);
@@ -78,4 +78,4 @@
78
78
 
79
79
  return plugin;
80
80
 
81
- })));
81
+ }));
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin['two-digit-year'] = factory()));
5
- }(this, (function () { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin["two-digit-year"] = factory()));
5
+ })(this, (function () { 'use strict';
6
6
 
7
7
  /**
8
8
  * @preserve date-and-time.js plugin
@@ -26,4 +26,4 @@
26
26
 
27
27
  return plugin;
28
28
 
29
- })));
29
+ }));