@everymatrix/general-footer-template 1.52.5 → 1.53.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.
Files changed (26) hide show
  1. package/dist/cjs/_commonjsHelpers-0a7b82d9.js +21 -0
  2. package/dist/cjs/custom-clock.cjs.entry.js +27 -2190
  3. package/dist/cjs/custom-content-section.cjs.entry.js +83 -99
  4. package/dist/cjs/general-footer-template.cjs.entry.js +2 -1
  5. package/dist/cjs/general-footer-template.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/custom-clock/custom-clock.js +33 -5
  8. package/dist/collection/components/general-footer-template/general-footer-template.js +20 -1
  9. package/dist/esm/_commonjsHelpers-57e89916.js +18 -0
  10. package/dist/esm/custom-clock.entry.js +27 -2190
  11. package/dist/esm/custom-content-section.entry.js +74 -90
  12. package/dist/esm/general-footer-template.entry.js +2 -1
  13. package/dist/esm/general-footer-template.js +1 -1
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/general-footer-template/general-footer-template.esm.js +1 -1
  16. package/dist/general-footer-template/p-65805523.entry.js +1 -0
  17. package/dist/general-footer-template/p-6fe03737.entry.js +8 -0
  18. package/dist/general-footer-template/p-cb65c223.js +1 -0
  19. package/dist/general-footer-template/p-db5af7af.entry.js +1 -0
  20. package/dist/types/components/custom-clock/custom-clock.d.ts +4 -0
  21. package/dist/types/components/general-footer-template/general-footer-template.d.ts +4 -0
  22. package/dist/types/components.d.ts +16 -0
  23. package/package.json +1 -1
  24. package/dist/general-footer-template/p-330130cd.entry.js +0 -1
  25. package/dist/general-footer-template/p-5982a2ca.entry.js +0 -8
  26. package/dist/general-footer-template/p-abce093a.entry.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-9775f5ee.js';
2
+ import { c as commonjsGlobal } from './_commonjsHelpers-57e89916.js';
2
3
 
3
4
  const DEFAULT_LANGUAGE = 'en';
4
5
  const TRANSLATIONS = {
@@ -43,2201 +44,29 @@ const translate = (key, customLang) => {
43
44
  return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
44
45
  };
45
46
 
46
- function _typeof(o) {
47
- "@babel/helpers - typeof";
47
+ var dayjs_min = {exports: {}};
48
48
 
49
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
50
- return typeof o;
51
- } : function (o) {
52
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
53
- }, _typeof(o);
54
- }
49
+ (function (module, exports) {
50
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
51
+ }(dayjs_min));
55
52
 
56
- function toInteger(dirtyNumber) {
57
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
58
- return NaN;
59
- }
60
- var number = Number(dirtyNumber);
61
- if (isNaN(number)) {
62
- return number;
63
- }
64
- return number < 0 ? Math.ceil(number) : Math.floor(number);
65
- }
53
+ const dayjs = dayjs_min.exports;
66
54
 
67
- function requiredArgs(required, args) {
68
- if (args.length < required) {
69
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
70
- }
71
- }
55
+ var utc$1 = {exports: {}};
72
56
 
73
- /**
74
- * @name toDate
75
- * @category Common Helpers
76
- * @summary Convert the given argument to an instance of Date.
77
- *
78
- * @description
79
- * Convert the given argument to an instance of Date.
80
- *
81
- * If the argument is an instance of Date, the function returns its clone.
82
- *
83
- * If the argument is a number, it is treated as a timestamp.
84
- *
85
- * If the argument is none of the above, the function returns Invalid Date.
86
- *
87
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
88
- *
89
- * @param {Date|Number} argument - the value to convert
90
- * @returns {Date} the parsed date in the local time zone
91
- * @throws {TypeError} 1 argument required
92
- *
93
- * @example
94
- * // Clone the date:
95
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
96
- * //=> Tue Feb 11 2014 11:30:30
97
- *
98
- * @example
99
- * // Convert the timestamp to date:
100
- * const result = toDate(1392098430000)
101
- * //=> Tue Feb 11 2014 11:30:30
102
- */
103
- function toDate(argument) {
104
- requiredArgs(1, arguments);
105
- var argStr = Object.prototype.toString.call(argument);
57
+ (function (module, exports) {
58
+ !function(t,i){module.exports=i();}(commonjsGlobal,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
59
+ }(utc$1));
106
60
 
107
- // Clone the date
108
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
109
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
110
- return new Date(argument.getTime());
111
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
112
- return new Date(argument);
113
- } else {
114
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
115
- // eslint-disable-next-line no-console
116
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
117
- // eslint-disable-next-line no-console
118
- console.warn(new Error().stack);
119
- }
120
- return new Date(NaN);
121
- }
122
- }
123
-
124
- /**
125
- * @name addMilliseconds
126
- * @category Millisecond Helpers
127
- * @summary Add the specified number of milliseconds to the given date.
128
- *
129
- * @description
130
- * Add the specified number of milliseconds to the given date.
131
- *
132
- * @param {Date|Number} date - the date to be changed
133
- * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
134
- * @returns {Date} the new date with the milliseconds added
135
- * @throws {TypeError} 2 arguments required
136
- *
137
- * @example
138
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
139
- * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
140
- * //=> Thu Jul 10 2014 12:45:30.750
141
- */
142
- function addMilliseconds(dirtyDate, dirtyAmount) {
143
- requiredArgs(2, arguments);
144
- var timestamp = toDate(dirtyDate).getTime();
145
- var amount = toInteger(dirtyAmount);
146
- return new Date(timestamp + amount);
147
- }
148
-
149
- var defaultOptions = {};
150
- function getDefaultOptions() {
151
- return defaultOptions;
152
- }
153
-
154
- /**
155
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
156
- * They usually appear for dates that denote time before the timezones were introduced
157
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
158
- * and GMT+01:00:00 after that date)
159
- *
160
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
161
- * which would lead to incorrect calculations.
162
- *
163
- * This function returns the timezone offset in milliseconds that takes seconds in account.
164
- */
165
- function getTimezoneOffsetInMilliseconds(date) {
166
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
167
- utcDate.setUTCFullYear(date.getFullYear());
168
- return date.getTime() - utcDate.getTime();
169
- }
170
-
171
- /**
172
- * @name isDate
173
- * @category Common Helpers
174
- * @summary Is the given value a date?
175
- *
176
- * @description
177
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
178
- *
179
- * @param {*} value - the value to check
180
- * @returns {boolean} true if the given value is a date
181
- * @throws {TypeError} 1 arguments required
182
- *
183
- * @example
184
- * // For a valid date:
185
- * const result = isDate(new Date())
186
- * //=> true
187
- *
188
- * @example
189
- * // For an invalid date:
190
- * const result = isDate(new Date(NaN))
191
- * //=> true
192
- *
193
- * @example
194
- * // For some value:
195
- * const result = isDate('2014-02-31')
196
- * //=> false
197
- *
198
- * @example
199
- * // For an object:
200
- * const result = isDate({})
201
- * //=> false
202
- */
203
- function isDate(value) {
204
- requiredArgs(1, arguments);
205
- return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
206
- }
207
-
208
- /**
209
- * @name isValid
210
- * @category Common Helpers
211
- * @summary Is the given date valid?
212
- *
213
- * @description
214
- * Returns false if argument is Invalid Date and true otherwise.
215
- * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
216
- * Invalid Date is a Date, whose time value is NaN.
217
- *
218
- * Time value of Date: http://es5.github.io/#x15.9.1.1
219
- *
220
- * @param {*} date - the date to check
221
- * @returns {Boolean} the date is valid
222
- * @throws {TypeError} 1 argument required
223
- *
224
- * @example
225
- * // For the valid date:
226
- * const result = isValid(new Date(2014, 1, 31))
227
- * //=> true
228
- *
229
- * @example
230
- * // For the value, convertable into a date:
231
- * const result = isValid(1393804800000)
232
- * //=> true
233
- *
234
- * @example
235
- * // For the invalid date:
236
- * const result = isValid(new Date(''))
237
- * //=> false
238
- */
239
- function isValid(dirtyDate) {
240
- requiredArgs(1, arguments);
241
- if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
242
- return false;
243
- }
244
- var date = toDate(dirtyDate);
245
- return !isNaN(Number(date));
246
- }
247
-
248
- /**
249
- * @name subMilliseconds
250
- * @category Millisecond Helpers
251
- * @summary Subtract the specified number of milliseconds from the given date.
252
- *
253
- * @description
254
- * Subtract the specified number of milliseconds from the given date.
255
- *
256
- * @param {Date|Number} date - the date to be changed
257
- * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
258
- * @returns {Date} the new date with the milliseconds subtracted
259
- * @throws {TypeError} 2 arguments required
260
- *
261
- * @example
262
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
263
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
264
- * //=> Thu Jul 10 2014 12:45:29.250
265
- */
266
- function subMilliseconds(dirtyDate, dirtyAmount) {
267
- requiredArgs(2, arguments);
268
- var amount = toInteger(dirtyAmount);
269
- return addMilliseconds(dirtyDate, -amount);
270
- }
271
-
272
- var MILLISECONDS_IN_DAY = 86400000;
273
- function getUTCDayOfYear(dirtyDate) {
274
- requiredArgs(1, arguments);
275
- var date = toDate(dirtyDate);
276
- var timestamp = date.getTime();
277
- date.setUTCMonth(0, 1);
278
- date.setUTCHours(0, 0, 0, 0);
279
- var startOfYearTimestamp = date.getTime();
280
- var difference = timestamp - startOfYearTimestamp;
281
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
282
- }
283
-
284
- function startOfUTCISOWeek(dirtyDate) {
285
- requiredArgs(1, arguments);
286
- var weekStartsOn = 1;
287
- var date = toDate(dirtyDate);
288
- var day = date.getUTCDay();
289
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
290
- date.setUTCDate(date.getUTCDate() - diff);
291
- date.setUTCHours(0, 0, 0, 0);
292
- return date;
293
- }
294
-
295
- function getUTCISOWeekYear(dirtyDate) {
296
- requiredArgs(1, arguments);
297
- var date = toDate(dirtyDate);
298
- var year = date.getUTCFullYear();
299
- var fourthOfJanuaryOfNextYear = new Date(0);
300
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
301
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
302
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
303
- var fourthOfJanuaryOfThisYear = new Date(0);
304
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
305
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
306
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
307
- if (date.getTime() >= startOfNextYear.getTime()) {
308
- return year + 1;
309
- } else if (date.getTime() >= startOfThisYear.getTime()) {
310
- return year;
311
- } else {
312
- return year - 1;
313
- }
314
- }
315
-
316
- function startOfUTCISOWeekYear(dirtyDate) {
317
- requiredArgs(1, arguments);
318
- var year = getUTCISOWeekYear(dirtyDate);
319
- var fourthOfJanuary = new Date(0);
320
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
321
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
322
- var date = startOfUTCISOWeek(fourthOfJanuary);
323
- return date;
324
- }
325
-
326
- var MILLISECONDS_IN_WEEK$1 = 604800000;
327
- function getUTCISOWeek(dirtyDate) {
328
- requiredArgs(1, arguments);
329
- var date = toDate(dirtyDate);
330
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
331
-
332
- // Round the number of days to the nearest integer
333
- // because the number of milliseconds in a week is not constant
334
- // (e.g. it's different in the week of the daylight saving time clock shift)
335
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
336
- }
337
-
338
- function startOfUTCWeek(dirtyDate, options) {
339
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
340
- requiredArgs(1, arguments);
341
- var defaultOptions = getDefaultOptions();
342
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
343
-
344
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
345
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
346
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
347
- }
348
- var date = toDate(dirtyDate);
349
- var day = date.getUTCDay();
350
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
351
- date.setUTCDate(date.getUTCDate() - diff);
352
- date.setUTCHours(0, 0, 0, 0);
353
- return date;
354
- }
355
-
356
- function getUTCWeekYear(dirtyDate, options) {
357
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
358
- requiredArgs(1, arguments);
359
- var date = toDate(dirtyDate);
360
- var year = date.getUTCFullYear();
361
- var defaultOptions = getDefaultOptions();
362
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
363
-
364
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
365
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
366
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
367
- }
368
- var firstWeekOfNextYear = new Date(0);
369
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
370
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
371
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
372
- var firstWeekOfThisYear = new Date(0);
373
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
374
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
375
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
376
- if (date.getTime() >= startOfNextYear.getTime()) {
377
- return year + 1;
378
- } else if (date.getTime() >= startOfThisYear.getTime()) {
379
- return year;
380
- } else {
381
- return year - 1;
382
- }
383
- }
384
-
385
- function startOfUTCWeekYear(dirtyDate, options) {
386
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
387
- requiredArgs(1, arguments);
388
- var defaultOptions = getDefaultOptions();
389
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
390
- var year = getUTCWeekYear(dirtyDate, options);
391
- var firstWeek = new Date(0);
392
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
393
- firstWeek.setUTCHours(0, 0, 0, 0);
394
- var date = startOfUTCWeek(firstWeek, options);
395
- return date;
396
- }
397
-
398
- var MILLISECONDS_IN_WEEK = 604800000;
399
- function getUTCWeek(dirtyDate, options) {
400
- requiredArgs(1, arguments);
401
- var date = toDate(dirtyDate);
402
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
403
-
404
- // Round the number of days to the nearest integer
405
- // because the number of milliseconds in a week is not constant
406
- // (e.g. it's different in the week of the daylight saving time clock shift)
407
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
408
- }
409
-
410
- function addLeadingZeros(number, targetLength) {
411
- var sign = number < 0 ? '-' : '';
412
- var output = Math.abs(number).toString();
413
- while (output.length < targetLength) {
414
- output = '0' + output;
415
- }
416
- return sign + output;
417
- }
418
-
419
- /*
420
- * | | Unit | | Unit |
421
- * |-----|--------------------------------|-----|--------------------------------|
422
- * | a | AM, PM | A* | |
423
- * | d | Day of month | D | |
424
- * | h | Hour [1-12] | H | Hour [0-23] |
425
- * | m | Minute | M | Month |
426
- * | s | Second | S | Fraction of second |
427
- * | y | Year (abs) | Y | |
428
- *
429
- * Letters marked by * are not implemented but reserved by Unicode standard.
430
- */
431
- var formatters$2 = {
432
- // Year
433
- y: function y(date, token) {
434
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
435
- // | Year | y | yy | yyy | yyyy | yyyyy |
436
- // |----------|-------|----|-------|-------|-------|
437
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
438
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
439
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
440
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
441
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
442
-
443
- var signedYear = date.getUTCFullYear();
444
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
445
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
446
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
447
- },
448
- // Month
449
- M: function M(date, token) {
450
- var month = date.getUTCMonth();
451
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
452
- },
453
- // Day of the month
454
- d: function d(date, token) {
455
- return addLeadingZeros(date.getUTCDate(), token.length);
456
- },
457
- // AM or PM
458
- a: function a(date, token) {
459
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
460
- switch (token) {
461
- case 'a':
462
- case 'aa':
463
- return dayPeriodEnumValue.toUpperCase();
464
- case 'aaa':
465
- return dayPeriodEnumValue;
466
- case 'aaaaa':
467
- return dayPeriodEnumValue[0];
468
- case 'aaaa':
469
- default:
470
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
471
- }
472
- },
473
- // Hour [1-12]
474
- h: function h(date, token) {
475
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
476
- },
477
- // Hour [0-23]
478
- H: function H(date, token) {
479
- return addLeadingZeros(date.getUTCHours(), token.length);
480
- },
481
- // Minute
482
- m: function m(date, token) {
483
- return addLeadingZeros(date.getUTCMinutes(), token.length);
484
- },
485
- // Second
486
- s: function s(date, token) {
487
- return addLeadingZeros(date.getUTCSeconds(), token.length);
488
- },
489
- // Fraction of second
490
- S: function S(date, token) {
491
- var numberOfDigits = token.length;
492
- var milliseconds = date.getUTCMilliseconds();
493
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
494
- return addLeadingZeros(fractionalSeconds, token.length);
495
- }
496
- };
497
- const formatters$3 = formatters$2;
498
-
499
- var dayPeriodEnum = {
500
- am: 'am',
501
- pm: 'pm',
502
- midnight: 'midnight',
503
- noon: 'noon',
504
- morning: 'morning',
505
- afternoon: 'afternoon',
506
- evening: 'evening',
507
- night: 'night'
508
- };
509
- /*
510
- * | | Unit | | Unit |
511
- * |-----|--------------------------------|-----|--------------------------------|
512
- * | a | AM, PM | A* | Milliseconds in day |
513
- * | b | AM, PM, noon, midnight | B | Flexible day period |
514
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
515
- * | d | Day of month | D | Day of year |
516
- * | e | Local day of week | E | Day of week |
517
- * | f | | F* | Day of week in month |
518
- * | g* | Modified Julian day | G | Era |
519
- * | h | Hour [1-12] | H | Hour [0-23] |
520
- * | i! | ISO day of week | I! | ISO week of year |
521
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
522
- * | k | Hour [1-24] | K | Hour [0-11] |
523
- * | l* | (deprecated) | L | Stand-alone month |
524
- * | m | Minute | M | Month |
525
- * | n | | N | |
526
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
527
- * | p! | Long localized time | P! | Long localized date |
528
- * | q | Stand-alone quarter | Q | Quarter |
529
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
530
- * | s | Second | S | Fraction of second |
531
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
532
- * | u | Extended year | U* | Cyclic year |
533
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
534
- * | w | Local week of year | W* | Week of month |
535
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
536
- * | y | Year (abs) | Y | Local week-numbering year |
537
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
538
- *
539
- * Letters marked by * are not implemented but reserved by Unicode standard.
540
- *
541
- * Letters marked by ! are non-standard, but implemented by date-fns:
542
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
543
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
544
- * i.e. 7 for Sunday, 1 for Monday, etc.
545
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
546
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
547
- * `R` is supposed to be used in conjunction with `I` and `i`
548
- * for universal ISO week-numbering date, whereas
549
- * `Y` is supposed to be used in conjunction with `w` and `e`
550
- * for week-numbering date specific to the locale.
551
- * - `P` is long localized date format
552
- * - `p` is long localized time format
553
- */
554
-
555
- var formatters = {
556
- // Era
557
- G: function G(date, token, localize) {
558
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
559
- switch (token) {
560
- // AD, BC
561
- case 'G':
562
- case 'GG':
563
- case 'GGG':
564
- return localize.era(era, {
565
- width: 'abbreviated'
566
- });
567
- // A, B
568
- case 'GGGGG':
569
- return localize.era(era, {
570
- width: 'narrow'
571
- });
572
- // Anno Domini, Before Christ
573
- case 'GGGG':
574
- default:
575
- return localize.era(era, {
576
- width: 'wide'
577
- });
578
- }
579
- },
580
- // Year
581
- y: function y(date, token, localize) {
582
- // Ordinal number
583
- if (token === 'yo') {
584
- var signedYear = date.getUTCFullYear();
585
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
586
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
587
- return localize.ordinalNumber(year, {
588
- unit: 'year'
589
- });
590
- }
591
- return formatters$3.y(date, token);
592
- },
593
- // Local week-numbering year
594
- Y: function Y(date, token, localize, options) {
595
- var signedWeekYear = getUTCWeekYear(date, options);
596
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
597
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
598
-
599
- // Two digit year
600
- if (token === 'YY') {
601
- var twoDigitYear = weekYear % 100;
602
- return addLeadingZeros(twoDigitYear, 2);
603
- }
604
-
605
- // Ordinal number
606
- if (token === 'Yo') {
607
- return localize.ordinalNumber(weekYear, {
608
- unit: 'year'
609
- });
610
- }
611
-
612
- // Padding
613
- return addLeadingZeros(weekYear, token.length);
614
- },
615
- // ISO week-numbering year
616
- R: function R(date, token) {
617
- var isoWeekYear = getUTCISOWeekYear(date);
618
-
619
- // Padding
620
- return addLeadingZeros(isoWeekYear, token.length);
621
- },
622
- // Extended year. This is a single number designating the year of this calendar system.
623
- // The main difference between `y` and `u` localizers are B.C. years:
624
- // | Year | `y` | `u` |
625
- // |------|-----|-----|
626
- // | AC 1 | 1 | 1 |
627
- // | BC 1 | 1 | 0 |
628
- // | BC 2 | 2 | -1 |
629
- // Also `yy` always returns the last two digits of a year,
630
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
631
- u: function u(date, token) {
632
- var year = date.getUTCFullYear();
633
- return addLeadingZeros(year, token.length);
634
- },
635
- // Quarter
636
- Q: function Q(date, token, localize) {
637
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
638
- switch (token) {
639
- // 1, 2, 3, 4
640
- case 'Q':
641
- return String(quarter);
642
- // 01, 02, 03, 04
643
- case 'QQ':
644
- return addLeadingZeros(quarter, 2);
645
- // 1st, 2nd, 3rd, 4th
646
- case 'Qo':
647
- return localize.ordinalNumber(quarter, {
648
- unit: 'quarter'
649
- });
650
- // Q1, Q2, Q3, Q4
651
- case 'QQQ':
652
- return localize.quarter(quarter, {
653
- width: 'abbreviated',
654
- context: 'formatting'
655
- });
656
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
657
- case 'QQQQQ':
658
- return localize.quarter(quarter, {
659
- width: 'narrow',
660
- context: 'formatting'
661
- });
662
- // 1st quarter, 2nd quarter, ...
663
- case 'QQQQ':
664
- default:
665
- return localize.quarter(quarter, {
666
- width: 'wide',
667
- context: 'formatting'
668
- });
669
- }
670
- },
671
- // Stand-alone quarter
672
- q: function q(date, token, localize) {
673
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
674
- switch (token) {
675
- // 1, 2, 3, 4
676
- case 'q':
677
- return String(quarter);
678
- // 01, 02, 03, 04
679
- case 'qq':
680
- return addLeadingZeros(quarter, 2);
681
- // 1st, 2nd, 3rd, 4th
682
- case 'qo':
683
- return localize.ordinalNumber(quarter, {
684
- unit: 'quarter'
685
- });
686
- // Q1, Q2, Q3, Q4
687
- case 'qqq':
688
- return localize.quarter(quarter, {
689
- width: 'abbreviated',
690
- context: 'standalone'
691
- });
692
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
693
- case 'qqqqq':
694
- return localize.quarter(quarter, {
695
- width: 'narrow',
696
- context: 'standalone'
697
- });
698
- // 1st quarter, 2nd quarter, ...
699
- case 'qqqq':
700
- default:
701
- return localize.quarter(quarter, {
702
- width: 'wide',
703
- context: 'standalone'
704
- });
705
- }
706
- },
707
- // Month
708
- M: function M(date, token, localize) {
709
- var month = date.getUTCMonth();
710
- switch (token) {
711
- case 'M':
712
- case 'MM':
713
- return formatters$3.M(date, token);
714
- // 1st, 2nd, ..., 12th
715
- case 'Mo':
716
- return localize.ordinalNumber(month + 1, {
717
- unit: 'month'
718
- });
719
- // Jan, Feb, ..., Dec
720
- case 'MMM':
721
- return localize.month(month, {
722
- width: 'abbreviated',
723
- context: 'formatting'
724
- });
725
- // J, F, ..., D
726
- case 'MMMMM':
727
- return localize.month(month, {
728
- width: 'narrow',
729
- context: 'formatting'
730
- });
731
- // January, February, ..., December
732
- case 'MMMM':
733
- default:
734
- return localize.month(month, {
735
- width: 'wide',
736
- context: 'formatting'
737
- });
738
- }
739
- },
740
- // Stand-alone month
741
- L: function L(date, token, localize) {
742
- var month = date.getUTCMonth();
743
- switch (token) {
744
- // 1, 2, ..., 12
745
- case 'L':
746
- return String(month + 1);
747
- // 01, 02, ..., 12
748
- case 'LL':
749
- return addLeadingZeros(month + 1, 2);
750
- // 1st, 2nd, ..., 12th
751
- case 'Lo':
752
- return localize.ordinalNumber(month + 1, {
753
- unit: 'month'
754
- });
755
- // Jan, Feb, ..., Dec
756
- case 'LLL':
757
- return localize.month(month, {
758
- width: 'abbreviated',
759
- context: 'standalone'
760
- });
761
- // J, F, ..., D
762
- case 'LLLLL':
763
- return localize.month(month, {
764
- width: 'narrow',
765
- context: 'standalone'
766
- });
767
- // January, February, ..., December
768
- case 'LLLL':
769
- default:
770
- return localize.month(month, {
771
- width: 'wide',
772
- context: 'standalone'
773
- });
774
- }
775
- },
776
- // Local week of year
777
- w: function w(date, token, localize, options) {
778
- var week = getUTCWeek(date, options);
779
- if (token === 'wo') {
780
- return localize.ordinalNumber(week, {
781
- unit: 'week'
782
- });
783
- }
784
- return addLeadingZeros(week, token.length);
785
- },
786
- // ISO week of year
787
- I: function I(date, token, localize) {
788
- var isoWeek = getUTCISOWeek(date);
789
- if (token === 'Io') {
790
- return localize.ordinalNumber(isoWeek, {
791
- unit: 'week'
792
- });
793
- }
794
- return addLeadingZeros(isoWeek, token.length);
795
- },
796
- // Day of the month
797
- d: function d(date, token, localize) {
798
- if (token === 'do') {
799
- return localize.ordinalNumber(date.getUTCDate(), {
800
- unit: 'date'
801
- });
802
- }
803
- return formatters$3.d(date, token);
804
- },
805
- // Day of year
806
- D: function D(date, token, localize) {
807
- var dayOfYear = getUTCDayOfYear(date);
808
- if (token === 'Do') {
809
- return localize.ordinalNumber(dayOfYear, {
810
- unit: 'dayOfYear'
811
- });
812
- }
813
- return addLeadingZeros(dayOfYear, token.length);
814
- },
815
- // Day of week
816
- E: function E(date, token, localize) {
817
- var dayOfWeek = date.getUTCDay();
818
- switch (token) {
819
- // Tue
820
- case 'E':
821
- case 'EE':
822
- case 'EEE':
823
- return localize.day(dayOfWeek, {
824
- width: 'abbreviated',
825
- context: 'formatting'
826
- });
827
- // T
828
- case 'EEEEE':
829
- return localize.day(dayOfWeek, {
830
- width: 'narrow',
831
- context: 'formatting'
832
- });
833
- // Tu
834
- case 'EEEEEE':
835
- return localize.day(dayOfWeek, {
836
- width: 'short',
837
- context: 'formatting'
838
- });
839
- // Tuesday
840
- case 'EEEE':
841
- default:
842
- return localize.day(dayOfWeek, {
843
- width: 'wide',
844
- context: 'formatting'
845
- });
846
- }
847
- },
848
- // Local day of week
849
- e: function e(date, token, localize, options) {
850
- var dayOfWeek = date.getUTCDay();
851
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
852
- switch (token) {
853
- // Numerical value (Nth day of week with current locale or weekStartsOn)
854
- case 'e':
855
- return String(localDayOfWeek);
856
- // Padded numerical value
857
- case 'ee':
858
- return addLeadingZeros(localDayOfWeek, 2);
859
- // 1st, 2nd, ..., 7th
860
- case 'eo':
861
- return localize.ordinalNumber(localDayOfWeek, {
862
- unit: 'day'
863
- });
864
- case 'eee':
865
- return localize.day(dayOfWeek, {
866
- width: 'abbreviated',
867
- context: 'formatting'
868
- });
869
- // T
870
- case 'eeeee':
871
- return localize.day(dayOfWeek, {
872
- width: 'narrow',
873
- context: 'formatting'
874
- });
875
- // Tu
876
- case 'eeeeee':
877
- return localize.day(dayOfWeek, {
878
- width: 'short',
879
- context: 'formatting'
880
- });
881
- // Tuesday
882
- case 'eeee':
883
- default:
884
- return localize.day(dayOfWeek, {
885
- width: 'wide',
886
- context: 'formatting'
887
- });
888
- }
889
- },
890
- // Stand-alone local day of week
891
- c: function c(date, token, localize, options) {
892
- var dayOfWeek = date.getUTCDay();
893
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
894
- switch (token) {
895
- // Numerical value (same as in `e`)
896
- case 'c':
897
- return String(localDayOfWeek);
898
- // Padded numerical value
899
- case 'cc':
900
- return addLeadingZeros(localDayOfWeek, token.length);
901
- // 1st, 2nd, ..., 7th
902
- case 'co':
903
- return localize.ordinalNumber(localDayOfWeek, {
904
- unit: 'day'
905
- });
906
- case 'ccc':
907
- return localize.day(dayOfWeek, {
908
- width: 'abbreviated',
909
- context: 'standalone'
910
- });
911
- // T
912
- case 'ccccc':
913
- return localize.day(dayOfWeek, {
914
- width: 'narrow',
915
- context: 'standalone'
916
- });
917
- // Tu
918
- case 'cccccc':
919
- return localize.day(dayOfWeek, {
920
- width: 'short',
921
- context: 'standalone'
922
- });
923
- // Tuesday
924
- case 'cccc':
925
- default:
926
- return localize.day(dayOfWeek, {
927
- width: 'wide',
928
- context: 'standalone'
929
- });
930
- }
931
- },
932
- // ISO day of week
933
- i: function i(date, token, localize) {
934
- var dayOfWeek = date.getUTCDay();
935
- var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
936
- switch (token) {
937
- // 2
938
- case 'i':
939
- return String(isoDayOfWeek);
940
- // 02
941
- case 'ii':
942
- return addLeadingZeros(isoDayOfWeek, token.length);
943
- // 2nd
944
- case 'io':
945
- return localize.ordinalNumber(isoDayOfWeek, {
946
- unit: 'day'
947
- });
948
- // Tue
949
- case 'iii':
950
- return localize.day(dayOfWeek, {
951
- width: 'abbreviated',
952
- context: 'formatting'
953
- });
954
- // T
955
- case 'iiiii':
956
- return localize.day(dayOfWeek, {
957
- width: 'narrow',
958
- context: 'formatting'
959
- });
960
- // Tu
961
- case 'iiiiii':
962
- return localize.day(dayOfWeek, {
963
- width: 'short',
964
- context: 'formatting'
965
- });
966
- // Tuesday
967
- case 'iiii':
968
- default:
969
- return localize.day(dayOfWeek, {
970
- width: 'wide',
971
- context: 'formatting'
972
- });
973
- }
974
- },
975
- // AM or PM
976
- a: function a(date, token, localize) {
977
- var hours = date.getUTCHours();
978
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
979
- switch (token) {
980
- case 'a':
981
- case 'aa':
982
- return localize.dayPeriod(dayPeriodEnumValue, {
983
- width: 'abbreviated',
984
- context: 'formatting'
985
- });
986
- case 'aaa':
987
- return localize.dayPeriod(dayPeriodEnumValue, {
988
- width: 'abbreviated',
989
- context: 'formatting'
990
- }).toLowerCase();
991
- case 'aaaaa':
992
- return localize.dayPeriod(dayPeriodEnumValue, {
993
- width: 'narrow',
994
- context: 'formatting'
995
- });
996
- case 'aaaa':
997
- default:
998
- return localize.dayPeriod(dayPeriodEnumValue, {
999
- width: 'wide',
1000
- context: 'formatting'
1001
- });
1002
- }
1003
- },
1004
- // AM, PM, midnight, noon
1005
- b: function b(date, token, localize) {
1006
- var hours = date.getUTCHours();
1007
- var dayPeriodEnumValue;
1008
- if (hours === 12) {
1009
- dayPeriodEnumValue = dayPeriodEnum.noon;
1010
- } else if (hours === 0) {
1011
- dayPeriodEnumValue = dayPeriodEnum.midnight;
1012
- } else {
1013
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1014
- }
1015
- switch (token) {
1016
- case 'b':
1017
- case 'bb':
1018
- return localize.dayPeriod(dayPeriodEnumValue, {
1019
- width: 'abbreviated',
1020
- context: 'formatting'
1021
- });
1022
- case 'bbb':
1023
- return localize.dayPeriod(dayPeriodEnumValue, {
1024
- width: 'abbreviated',
1025
- context: 'formatting'
1026
- }).toLowerCase();
1027
- case 'bbbbb':
1028
- return localize.dayPeriod(dayPeriodEnumValue, {
1029
- width: 'narrow',
1030
- context: 'formatting'
1031
- });
1032
- case 'bbbb':
1033
- default:
1034
- return localize.dayPeriod(dayPeriodEnumValue, {
1035
- width: 'wide',
1036
- context: 'formatting'
1037
- });
1038
- }
1039
- },
1040
- // in the morning, in the afternoon, in the evening, at night
1041
- B: function B(date, token, localize) {
1042
- var hours = date.getUTCHours();
1043
- var dayPeriodEnumValue;
1044
- if (hours >= 17) {
1045
- dayPeriodEnumValue = dayPeriodEnum.evening;
1046
- } else if (hours >= 12) {
1047
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
1048
- } else if (hours >= 4) {
1049
- dayPeriodEnumValue = dayPeriodEnum.morning;
1050
- } else {
1051
- dayPeriodEnumValue = dayPeriodEnum.night;
1052
- }
1053
- switch (token) {
1054
- case 'B':
1055
- case 'BB':
1056
- case 'BBB':
1057
- return localize.dayPeriod(dayPeriodEnumValue, {
1058
- width: 'abbreviated',
1059
- context: 'formatting'
1060
- });
1061
- case 'BBBBB':
1062
- return localize.dayPeriod(dayPeriodEnumValue, {
1063
- width: 'narrow',
1064
- context: 'formatting'
1065
- });
1066
- case 'BBBB':
1067
- default:
1068
- return localize.dayPeriod(dayPeriodEnumValue, {
1069
- width: 'wide',
1070
- context: 'formatting'
1071
- });
1072
- }
1073
- },
1074
- // Hour [1-12]
1075
- h: function h(date, token, localize) {
1076
- if (token === 'ho') {
1077
- var hours = date.getUTCHours() % 12;
1078
- if (hours === 0) hours = 12;
1079
- return localize.ordinalNumber(hours, {
1080
- unit: 'hour'
1081
- });
1082
- }
1083
- return formatters$3.h(date, token);
1084
- },
1085
- // Hour [0-23]
1086
- H: function H(date, token, localize) {
1087
- if (token === 'Ho') {
1088
- return localize.ordinalNumber(date.getUTCHours(), {
1089
- unit: 'hour'
1090
- });
1091
- }
1092
- return formatters$3.H(date, token);
1093
- },
1094
- // Hour [0-11]
1095
- K: function K(date, token, localize) {
1096
- var hours = date.getUTCHours() % 12;
1097
- if (token === 'Ko') {
1098
- return localize.ordinalNumber(hours, {
1099
- unit: 'hour'
1100
- });
1101
- }
1102
- return addLeadingZeros(hours, token.length);
1103
- },
1104
- // Hour [1-24]
1105
- k: function k(date, token, localize) {
1106
- var hours = date.getUTCHours();
1107
- if (hours === 0) hours = 24;
1108
- if (token === 'ko') {
1109
- return localize.ordinalNumber(hours, {
1110
- unit: 'hour'
1111
- });
1112
- }
1113
- return addLeadingZeros(hours, token.length);
1114
- },
1115
- // Minute
1116
- m: function m(date, token, localize) {
1117
- if (token === 'mo') {
1118
- return localize.ordinalNumber(date.getUTCMinutes(), {
1119
- unit: 'minute'
1120
- });
1121
- }
1122
- return formatters$3.m(date, token);
1123
- },
1124
- // Second
1125
- s: function s(date, token, localize) {
1126
- if (token === 'so') {
1127
- return localize.ordinalNumber(date.getUTCSeconds(), {
1128
- unit: 'second'
1129
- });
1130
- }
1131
- return formatters$3.s(date, token);
1132
- },
1133
- // Fraction of second
1134
- S: function S(date, token) {
1135
- return formatters$3.S(date, token);
1136
- },
1137
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1138
- X: function X(date, token, _localize, options) {
1139
- var originalDate = options._originalDate || date;
1140
- var timezoneOffset = originalDate.getTimezoneOffset();
1141
- if (timezoneOffset === 0) {
1142
- return 'Z';
1143
- }
1144
- switch (token) {
1145
- // Hours and optional minutes
1146
- case 'X':
1147
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1148
-
1149
- // Hours, minutes and optional seconds without `:` delimiter
1150
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1151
- // so this token always has the same output as `XX`
1152
- case 'XXXX':
1153
- case 'XX':
1154
- // Hours and minutes without `:` delimiter
1155
- return formatTimezone(timezoneOffset);
1156
-
1157
- // Hours, minutes and optional seconds with `:` delimiter
1158
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1159
- // so this token always has the same output as `XXX`
1160
- case 'XXXXX':
1161
- case 'XXX': // Hours and minutes with `:` delimiter
1162
- default:
1163
- return formatTimezone(timezoneOffset, ':');
1164
- }
1165
- },
1166
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1167
- x: function x(date, token, _localize, options) {
1168
- var originalDate = options._originalDate || date;
1169
- var timezoneOffset = originalDate.getTimezoneOffset();
1170
- switch (token) {
1171
- // Hours and optional minutes
1172
- case 'x':
1173
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1174
-
1175
- // Hours, minutes and optional seconds without `:` delimiter
1176
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1177
- // so this token always has the same output as `xx`
1178
- case 'xxxx':
1179
- case 'xx':
1180
- // Hours and minutes without `:` delimiter
1181
- return formatTimezone(timezoneOffset);
1182
-
1183
- // Hours, minutes and optional seconds with `:` delimiter
1184
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1185
- // so this token always has the same output as `xxx`
1186
- case 'xxxxx':
1187
- case 'xxx': // Hours and minutes with `:` delimiter
1188
- default:
1189
- return formatTimezone(timezoneOffset, ':');
1190
- }
1191
- },
1192
- // Timezone (GMT)
1193
- O: function O(date, token, _localize, options) {
1194
- var originalDate = options._originalDate || date;
1195
- var timezoneOffset = originalDate.getTimezoneOffset();
1196
- switch (token) {
1197
- // Short
1198
- case 'O':
1199
- case 'OO':
1200
- case 'OOO':
1201
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1202
- // Long
1203
- case 'OOOO':
1204
- default:
1205
- return 'GMT' + formatTimezone(timezoneOffset, ':');
1206
- }
1207
- },
1208
- // Timezone (specific non-location)
1209
- z: function z(date, token, _localize, options) {
1210
- var originalDate = options._originalDate || date;
1211
- var timezoneOffset = originalDate.getTimezoneOffset();
1212
- switch (token) {
1213
- // Short
1214
- case 'z':
1215
- case 'zz':
1216
- case 'zzz':
1217
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1218
- // Long
1219
- case 'zzzz':
1220
- default:
1221
- return 'GMT' + formatTimezone(timezoneOffset, ':');
1222
- }
1223
- },
1224
- // Seconds timestamp
1225
- t: function t(date, token, _localize, options) {
1226
- var originalDate = options._originalDate || date;
1227
- var timestamp = Math.floor(originalDate.getTime() / 1000);
1228
- return addLeadingZeros(timestamp, token.length);
1229
- },
1230
- // Milliseconds timestamp
1231
- T: function T(date, token, _localize, options) {
1232
- var originalDate = options._originalDate || date;
1233
- var timestamp = originalDate.getTime();
1234
- return addLeadingZeros(timestamp, token.length);
1235
- }
1236
- };
1237
- function formatTimezoneShort(offset, dirtyDelimiter) {
1238
- var sign = offset > 0 ? '-' : '+';
1239
- var absOffset = Math.abs(offset);
1240
- var hours = Math.floor(absOffset / 60);
1241
- var minutes = absOffset % 60;
1242
- if (minutes === 0) {
1243
- return sign + String(hours);
1244
- }
1245
- var delimiter = dirtyDelimiter || '';
1246
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1247
- }
1248
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1249
- if (offset % 60 === 0) {
1250
- var sign = offset > 0 ? '-' : '+';
1251
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1252
- }
1253
- return formatTimezone(offset, dirtyDelimiter);
1254
- }
1255
- function formatTimezone(offset, dirtyDelimiter) {
1256
- var delimiter = dirtyDelimiter || '';
1257
- var sign = offset > 0 ? '-' : '+';
1258
- var absOffset = Math.abs(offset);
1259
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1260
- var minutes = addLeadingZeros(absOffset % 60, 2);
1261
- return sign + hours + delimiter + minutes;
1262
- }
1263
- const formatters$1 = formatters;
1264
-
1265
- var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1266
- switch (pattern) {
1267
- case 'P':
1268
- return formatLong.date({
1269
- width: 'short'
1270
- });
1271
- case 'PP':
1272
- return formatLong.date({
1273
- width: 'medium'
1274
- });
1275
- case 'PPP':
1276
- return formatLong.date({
1277
- width: 'long'
1278
- });
1279
- case 'PPPP':
1280
- default:
1281
- return formatLong.date({
1282
- width: 'full'
1283
- });
1284
- }
1285
- };
1286
- var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1287
- switch (pattern) {
1288
- case 'p':
1289
- return formatLong.time({
1290
- width: 'short'
1291
- });
1292
- case 'pp':
1293
- return formatLong.time({
1294
- width: 'medium'
1295
- });
1296
- case 'ppp':
1297
- return formatLong.time({
1298
- width: 'long'
1299
- });
1300
- case 'pppp':
1301
- default:
1302
- return formatLong.time({
1303
- width: 'full'
1304
- });
1305
- }
1306
- };
1307
- var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1308
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
1309
- var datePattern = matchResult[1];
1310
- var timePattern = matchResult[2];
1311
- if (!timePattern) {
1312
- return dateLongFormatter(pattern, formatLong);
1313
- }
1314
- var dateTimeFormat;
1315
- switch (datePattern) {
1316
- case 'P':
1317
- dateTimeFormat = formatLong.dateTime({
1318
- width: 'short'
1319
- });
1320
- break;
1321
- case 'PP':
1322
- dateTimeFormat = formatLong.dateTime({
1323
- width: 'medium'
1324
- });
1325
- break;
1326
- case 'PPP':
1327
- dateTimeFormat = formatLong.dateTime({
1328
- width: 'long'
1329
- });
1330
- break;
1331
- case 'PPPP':
1332
- default:
1333
- dateTimeFormat = formatLong.dateTime({
1334
- width: 'full'
1335
- });
1336
- break;
1337
- }
1338
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1339
- };
1340
- var longFormatters = {
1341
- p: timeLongFormatter,
1342
- P: dateTimeLongFormatter
1343
- };
1344
- const longFormatters$1 = longFormatters;
1345
-
1346
- var protectedDayOfYearTokens = ['D', 'DD'];
1347
- var protectedWeekYearTokens = ['YY', 'YYYY'];
1348
- function isProtectedDayOfYearToken(token) {
1349
- return protectedDayOfYearTokens.indexOf(token) !== -1;
1350
- }
1351
- function isProtectedWeekYearToken(token) {
1352
- return protectedWeekYearTokens.indexOf(token) !== -1;
1353
- }
1354
- function throwProtectedError(token, format, input) {
1355
- if (token === 'YYYY') {
1356
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1357
- } else if (token === 'YY') {
1358
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1359
- } else if (token === 'D') {
1360
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1361
- } else if (token === 'DD') {
1362
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1363
- }
1364
- }
1365
-
1366
- var formatDistanceLocale = {
1367
- lessThanXSeconds: {
1368
- one: 'less than a second',
1369
- other: 'less than {{count}} seconds'
1370
- },
1371
- xSeconds: {
1372
- one: '1 second',
1373
- other: '{{count}} seconds'
1374
- },
1375
- halfAMinute: 'half a minute',
1376
- lessThanXMinutes: {
1377
- one: 'less than a minute',
1378
- other: 'less than {{count}} minutes'
1379
- },
1380
- xMinutes: {
1381
- one: '1 minute',
1382
- other: '{{count}} minutes'
1383
- },
1384
- aboutXHours: {
1385
- one: 'about 1 hour',
1386
- other: 'about {{count}} hours'
1387
- },
1388
- xHours: {
1389
- one: '1 hour',
1390
- other: '{{count}} hours'
1391
- },
1392
- xDays: {
1393
- one: '1 day',
1394
- other: '{{count}} days'
1395
- },
1396
- aboutXWeeks: {
1397
- one: 'about 1 week',
1398
- other: 'about {{count}} weeks'
1399
- },
1400
- xWeeks: {
1401
- one: '1 week',
1402
- other: '{{count}} weeks'
1403
- },
1404
- aboutXMonths: {
1405
- one: 'about 1 month',
1406
- other: 'about {{count}} months'
1407
- },
1408
- xMonths: {
1409
- one: '1 month',
1410
- other: '{{count}} months'
1411
- },
1412
- aboutXYears: {
1413
- one: 'about 1 year',
1414
- other: 'about {{count}} years'
1415
- },
1416
- xYears: {
1417
- one: '1 year',
1418
- other: '{{count}} years'
1419
- },
1420
- overXYears: {
1421
- one: 'over 1 year',
1422
- other: 'over {{count}} years'
1423
- },
1424
- almostXYears: {
1425
- one: 'almost 1 year',
1426
- other: 'almost {{count}} years'
1427
- }
1428
- };
1429
- var formatDistance = function formatDistance(token, count, options) {
1430
- var result;
1431
- var tokenValue = formatDistanceLocale[token];
1432
- if (typeof tokenValue === 'string') {
1433
- result = tokenValue;
1434
- } else if (count === 1) {
1435
- result = tokenValue.one;
1436
- } else {
1437
- result = tokenValue.other.replace('{{count}}', count.toString());
1438
- }
1439
- if (options !== null && options !== void 0 && options.addSuffix) {
1440
- if (options.comparison && options.comparison > 0) {
1441
- return 'in ' + result;
1442
- } else {
1443
- return result + ' ago';
1444
- }
1445
- }
1446
- return result;
1447
- };
1448
- const formatDistance$1 = formatDistance;
1449
-
1450
- function buildFormatLongFn(args) {
1451
- return function () {
1452
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1453
- // TODO: Remove String()
1454
- var width = options.width ? String(options.width) : args.defaultWidth;
1455
- var format = args.formats[width] || args.formats[args.defaultWidth];
1456
- return format;
1457
- };
1458
- }
1459
-
1460
- var dateFormats = {
1461
- full: 'EEEE, MMMM do, y',
1462
- long: 'MMMM do, y',
1463
- medium: 'MMM d, y',
1464
- short: 'MM/dd/yyyy'
1465
- };
1466
- var timeFormats = {
1467
- full: 'h:mm:ss a zzzz',
1468
- long: 'h:mm:ss a z',
1469
- medium: 'h:mm:ss a',
1470
- short: 'h:mm a'
1471
- };
1472
- var dateTimeFormats = {
1473
- full: "{{date}} 'at' {{time}}",
1474
- long: "{{date}} 'at' {{time}}",
1475
- medium: '{{date}}, {{time}}',
1476
- short: '{{date}}, {{time}}'
1477
- };
1478
- var formatLong = {
1479
- date: buildFormatLongFn({
1480
- formats: dateFormats,
1481
- defaultWidth: 'full'
1482
- }),
1483
- time: buildFormatLongFn({
1484
- formats: timeFormats,
1485
- defaultWidth: 'full'
1486
- }),
1487
- dateTime: buildFormatLongFn({
1488
- formats: dateTimeFormats,
1489
- defaultWidth: 'full'
1490
- })
1491
- };
1492
- const formatLong$1 = formatLong;
1493
-
1494
- var formatRelativeLocale = {
1495
- lastWeek: "'last' eeee 'at' p",
1496
- yesterday: "'yesterday at' p",
1497
- today: "'today at' p",
1498
- tomorrow: "'tomorrow at' p",
1499
- nextWeek: "eeee 'at' p",
1500
- other: 'P'
1501
- };
1502
- var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1503
- return formatRelativeLocale[token];
1504
- };
1505
- const formatRelative$1 = formatRelative;
1506
-
1507
- function buildLocalizeFn(args) {
1508
- return function (dirtyIndex, options) {
1509
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1510
- var valuesArray;
1511
- if (context === 'formatting' && args.formattingValues) {
1512
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1513
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1514
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1515
- } else {
1516
- var _defaultWidth = args.defaultWidth;
1517
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1518
- valuesArray = args.values[_width] || args.values[_defaultWidth];
1519
- }
1520
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1521
- // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1522
- return valuesArray[index];
1523
- };
1524
- }
1525
-
1526
- var eraValues = {
1527
- narrow: ['B', 'A'],
1528
- abbreviated: ['BC', 'AD'],
1529
- wide: ['Before Christ', 'Anno Domini']
1530
- };
1531
- var quarterValues = {
1532
- narrow: ['1', '2', '3', '4'],
1533
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1534
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1535
- };
1536
-
1537
- // Note: in English, the names of days of the week and months are capitalized.
1538
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1539
- // Generally, formatted dates should look like they are in the middle of a sentence,
1540
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
1541
- var monthValues = {
1542
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1543
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1544
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1545
- };
1546
- var dayValues = {
1547
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1548
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1549
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1550
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1551
- };
1552
- var dayPeriodValues = {
1553
- narrow: {
1554
- am: 'a',
1555
- pm: 'p',
1556
- midnight: 'mi',
1557
- noon: 'n',
1558
- morning: 'morning',
1559
- afternoon: 'afternoon',
1560
- evening: 'evening',
1561
- night: 'night'
1562
- },
1563
- abbreviated: {
1564
- am: 'AM',
1565
- pm: 'PM',
1566
- midnight: 'midnight',
1567
- noon: 'noon',
1568
- morning: 'morning',
1569
- afternoon: 'afternoon',
1570
- evening: 'evening',
1571
- night: 'night'
1572
- },
1573
- wide: {
1574
- am: 'a.m.',
1575
- pm: 'p.m.',
1576
- midnight: 'midnight',
1577
- noon: 'noon',
1578
- morning: 'morning',
1579
- afternoon: 'afternoon',
1580
- evening: 'evening',
1581
- night: 'night'
1582
- }
1583
- };
1584
- var formattingDayPeriodValues = {
1585
- narrow: {
1586
- am: 'a',
1587
- pm: 'p',
1588
- midnight: 'mi',
1589
- noon: 'n',
1590
- morning: 'in the morning',
1591
- afternoon: 'in the afternoon',
1592
- evening: 'in the evening',
1593
- night: 'at night'
1594
- },
1595
- abbreviated: {
1596
- am: 'AM',
1597
- pm: 'PM',
1598
- midnight: 'midnight',
1599
- noon: 'noon',
1600
- morning: 'in the morning',
1601
- afternoon: 'in the afternoon',
1602
- evening: 'in the evening',
1603
- night: 'at night'
1604
- },
1605
- wide: {
1606
- am: 'a.m.',
1607
- pm: 'p.m.',
1608
- midnight: 'midnight',
1609
- noon: 'noon',
1610
- morning: 'in the morning',
1611
- afternoon: 'in the afternoon',
1612
- evening: 'in the evening',
1613
- night: 'at night'
1614
- }
1615
- };
1616
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1617
- var number = Number(dirtyNumber);
1618
-
1619
- // If ordinal numbers depend on context, for example,
1620
- // if they are different for different grammatical genders,
1621
- // use `options.unit`.
1622
- //
1623
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1624
- // 'day', 'hour', 'minute', 'second'.
1625
-
1626
- var rem100 = number % 100;
1627
- if (rem100 > 20 || rem100 < 10) {
1628
- switch (rem100 % 10) {
1629
- case 1:
1630
- return number + 'st';
1631
- case 2:
1632
- return number + 'nd';
1633
- case 3:
1634
- return number + 'rd';
1635
- }
1636
- }
1637
- return number + 'th';
1638
- };
1639
- var localize = {
1640
- ordinalNumber: ordinalNumber,
1641
- era: buildLocalizeFn({
1642
- values: eraValues,
1643
- defaultWidth: 'wide'
1644
- }),
1645
- quarter: buildLocalizeFn({
1646
- values: quarterValues,
1647
- defaultWidth: 'wide',
1648
- argumentCallback: function argumentCallback(quarter) {
1649
- return quarter - 1;
1650
- }
1651
- }),
1652
- month: buildLocalizeFn({
1653
- values: monthValues,
1654
- defaultWidth: 'wide'
1655
- }),
1656
- day: buildLocalizeFn({
1657
- values: dayValues,
1658
- defaultWidth: 'wide'
1659
- }),
1660
- dayPeriod: buildLocalizeFn({
1661
- values: dayPeriodValues,
1662
- defaultWidth: 'wide',
1663
- formattingValues: formattingDayPeriodValues,
1664
- defaultFormattingWidth: 'wide'
1665
- })
1666
- };
1667
- const localize$1 = localize;
1668
-
1669
- function buildMatchFn(args) {
1670
- return function (string) {
1671
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1672
- var width = options.width;
1673
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1674
- var matchResult = string.match(matchPattern);
1675
- if (!matchResult) {
1676
- return null;
1677
- }
1678
- var matchedString = matchResult[0];
1679
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1680
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1681
- return pattern.test(matchedString);
1682
- }) : findKey(parsePatterns, function (pattern) {
1683
- return pattern.test(matchedString);
1684
- });
1685
- var value;
1686
- value = args.valueCallback ? args.valueCallback(key) : key;
1687
- value = options.valueCallback ? options.valueCallback(value) : value;
1688
- var rest = string.slice(matchedString.length);
1689
- return {
1690
- value: value,
1691
- rest: rest
1692
- };
1693
- };
1694
- }
1695
- function findKey(object, predicate) {
1696
- for (var key in object) {
1697
- if (object.hasOwnProperty(key) && predicate(object[key])) {
1698
- return key;
1699
- }
1700
- }
1701
- return undefined;
1702
- }
1703
- function findIndex(array, predicate) {
1704
- for (var key = 0; key < array.length; key++) {
1705
- if (predicate(array[key])) {
1706
- return key;
1707
- }
1708
- }
1709
- return undefined;
1710
- }
1711
-
1712
- function buildMatchPatternFn(args) {
1713
- return function (string) {
1714
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1715
- var matchResult = string.match(args.matchPattern);
1716
- if (!matchResult) return null;
1717
- var matchedString = matchResult[0];
1718
- var parseResult = string.match(args.parsePattern);
1719
- if (!parseResult) return null;
1720
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1721
- value = options.valueCallback ? options.valueCallback(value) : value;
1722
- var rest = string.slice(matchedString.length);
1723
- return {
1724
- value: value,
1725
- rest: rest
1726
- };
1727
- };
1728
- }
1729
-
1730
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1731
- var parseOrdinalNumberPattern = /\d+/i;
1732
- var matchEraPatterns = {
1733
- narrow: /^(b|a)/i,
1734
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1735
- wide: /^(before christ|before common era|anno domini|common era)/i
1736
- };
1737
- var parseEraPatterns = {
1738
- any: [/^b/i, /^(a|c)/i]
1739
- };
1740
- var matchQuarterPatterns = {
1741
- narrow: /^[1234]/i,
1742
- abbreviated: /^q[1234]/i,
1743
- wide: /^[1234](th|st|nd|rd)? quarter/i
1744
- };
1745
- var parseQuarterPatterns = {
1746
- any: [/1/i, /2/i, /3/i, /4/i]
1747
- };
1748
- var matchMonthPatterns = {
1749
- narrow: /^[jfmasond]/i,
1750
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1751
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1752
- };
1753
- var parseMonthPatterns = {
1754
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1755
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1756
- };
1757
- var matchDayPatterns = {
1758
- narrow: /^[smtwf]/i,
1759
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1760
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1761
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1762
- };
1763
- var parseDayPatterns = {
1764
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1765
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1766
- };
1767
- var matchDayPeriodPatterns = {
1768
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1769
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1770
- };
1771
- var parseDayPeriodPatterns = {
1772
- any: {
1773
- am: /^a/i,
1774
- pm: /^p/i,
1775
- midnight: /^mi/i,
1776
- noon: /^no/i,
1777
- morning: /morning/i,
1778
- afternoon: /afternoon/i,
1779
- evening: /evening/i,
1780
- night: /night/i
1781
- }
1782
- };
1783
- var match = {
1784
- ordinalNumber: buildMatchPatternFn({
1785
- matchPattern: matchOrdinalNumberPattern,
1786
- parsePattern: parseOrdinalNumberPattern,
1787
- valueCallback: function valueCallback(value) {
1788
- return parseInt(value, 10);
1789
- }
1790
- }),
1791
- era: buildMatchFn({
1792
- matchPatterns: matchEraPatterns,
1793
- defaultMatchWidth: 'wide',
1794
- parsePatterns: parseEraPatterns,
1795
- defaultParseWidth: 'any'
1796
- }),
1797
- quarter: buildMatchFn({
1798
- matchPatterns: matchQuarterPatterns,
1799
- defaultMatchWidth: 'wide',
1800
- parsePatterns: parseQuarterPatterns,
1801
- defaultParseWidth: 'any',
1802
- valueCallback: function valueCallback(index) {
1803
- return index + 1;
1804
- }
1805
- }),
1806
- month: buildMatchFn({
1807
- matchPatterns: matchMonthPatterns,
1808
- defaultMatchWidth: 'wide',
1809
- parsePatterns: parseMonthPatterns,
1810
- defaultParseWidth: 'any'
1811
- }),
1812
- day: buildMatchFn({
1813
- matchPatterns: matchDayPatterns,
1814
- defaultMatchWidth: 'wide',
1815
- parsePatterns: parseDayPatterns,
1816
- defaultParseWidth: 'any'
1817
- }),
1818
- dayPeriod: buildMatchFn({
1819
- matchPatterns: matchDayPeriodPatterns,
1820
- defaultMatchWidth: 'any',
1821
- parsePatterns: parseDayPeriodPatterns,
1822
- defaultParseWidth: 'any'
1823
- })
1824
- };
1825
- const match$1 = match;
1826
-
1827
- /**
1828
- * @type {Locale}
1829
- * @category Locales
1830
- * @summary English locale (United States).
1831
- * @language English
1832
- * @iso-639-2 eng
1833
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1834
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1835
- */
1836
- var locale = {
1837
- code: 'en-US',
1838
- formatDistance: formatDistance$1,
1839
- formatLong: formatLong$1,
1840
- formatRelative: formatRelative$1,
1841
- localize: localize$1,
1842
- match: match$1,
1843
- options: {
1844
- weekStartsOn: 0 /* Sunday */,
1845
- firstWeekContainsDate: 1
1846
- }
1847
- };
1848
- const defaultLocale = locale;
61
+ const utc = utc$1.exports;
1849
62
 
1850
- // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1851
- // (one of the certain letters followed by `o`)
1852
- // - (\w)\1* matches any sequences of the same letter
1853
- // - '' matches two quote characters in a row
1854
- // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1855
- // except a single quote symbol, which ends the sequence.
1856
- // Two quote characters do not end the sequence.
1857
- // If there is no matching single quote
1858
- // then the sequence will continue until the end of the string.
1859
- // - . matches any single character unmatched by previous parts of the RegExps
1860
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
63
+ var timezone$1 = {exports: {}};
1861
64
 
1862
- // This RegExp catches symbols escaped by quotes, and also
1863
- // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1864
- var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1865
- var escapedStringRegExp = /^'([^]*?)'?$/;
1866
- var doubleQuoteRegExp = /''/g;
1867
- var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
65
+ (function (module, exports) {
66
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r}(n,i);return r.formatToParts(o)},u=function(e,n){for(var i=a(e,n),r=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(r[c]=parseInt(m,10));}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return (o.utc(h).valueOf()-(v-=v%1e3))/6e4},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n,i=this.utcOffset(),a=this.toDate(),u=a.toLocaleString("en-US",{timeZone:t}),f=Math.round((a-new Date(u))/1e3/60),s=15*-Math.round(a.getTimezoneOffset()/15)-f;if(!Number(s))n=this.utcOffset(0,e);else if(n=o(u,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(s,!0),e){var m=n.utcOffset();n=n.add(i-m,"minute");}return n.$x.$timezone=t,n},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return "timezonename"===t.type.toLowerCase()}));return n&&n.value};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return [i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)]}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){r=t;};}}));
67
+ }(timezone$1));
1868
68
 
1869
- /**
1870
- * @name format
1871
- * @category Common Helpers
1872
- * @summary Format the date.
1873
- *
1874
- * @description
1875
- * Return the formatted date string in the given format. The result may vary by locale.
1876
- *
1877
- * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1878
- * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1879
- *
1880
- * The characters wrapped between two single quotes characters (') are escaped.
1881
- * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1882
- * (see the last example)
1883
- *
1884
- * Format of the string is based on Unicode Technical Standard #35:
1885
- * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1886
- * with a few additions (see note 7 below the table).
1887
- *
1888
- * Accepted patterns:
1889
- * | Unit | Pattern | Result examples | Notes |
1890
- * |---------------------------------|---------|-----------------------------------|-------|
1891
- * | Era | G..GGG | AD, BC | |
1892
- * | | GGGG | Anno Domini, Before Christ | 2 |
1893
- * | | GGGGG | A, B | |
1894
- * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1895
- * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1896
- * | | yy | 44, 01, 00, 17 | 5 |
1897
- * | | yyy | 044, 001, 1900, 2017 | 5 |
1898
- * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1899
- * | | yyyyy | ... | 3,5 |
1900
- * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1901
- * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1902
- * | | YY | 44, 01, 00, 17 | 5,8 |
1903
- * | | YYY | 044, 001, 1900, 2017 | 5 |
1904
- * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1905
- * | | YYYYY | ... | 3,5 |
1906
- * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1907
- * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1908
- * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1909
- * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1910
- * | | RRRRR | ... | 3,5,7 |
1911
- * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1912
- * | | uu | -43, 01, 1900, 2017 | 5 |
1913
- * | | uuu | -043, 001, 1900, 2017 | 5 |
1914
- * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1915
- * | | uuuuu | ... | 3,5 |
1916
- * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1917
- * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1918
- * | | QQ | 01, 02, 03, 04 | |
1919
- * | | QQQ | Q1, Q2, Q3, Q4 | |
1920
- * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1921
- * | | QQQQQ | 1, 2, 3, 4 | 4 |
1922
- * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1923
- * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1924
- * | | qq | 01, 02, 03, 04 | |
1925
- * | | qqq | Q1, Q2, Q3, Q4 | |
1926
- * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1927
- * | | qqqqq | 1, 2, 3, 4 | 4 |
1928
- * | Month (formatting) | M | 1, 2, ..., 12 | |
1929
- * | | Mo | 1st, 2nd, ..., 12th | 7 |
1930
- * | | MM | 01, 02, ..., 12 | |
1931
- * | | MMM | Jan, Feb, ..., Dec | |
1932
- * | | MMMM | January, February, ..., December | 2 |
1933
- * | | MMMMM | J, F, ..., D | |
1934
- * | Month (stand-alone) | L | 1, 2, ..., 12 | |
1935
- * | | Lo | 1st, 2nd, ..., 12th | 7 |
1936
- * | | LL | 01, 02, ..., 12 | |
1937
- * | | LLL | Jan, Feb, ..., Dec | |
1938
- * | | LLLL | January, February, ..., December | 2 |
1939
- * | | LLLLL | J, F, ..., D | |
1940
- * | Local week of year | w | 1, 2, ..., 53 | |
1941
- * | | wo | 1st, 2nd, ..., 53th | 7 |
1942
- * | | ww | 01, 02, ..., 53 | |
1943
- * | ISO week of year | I | 1, 2, ..., 53 | 7 |
1944
- * | | Io | 1st, 2nd, ..., 53th | 7 |
1945
- * | | II | 01, 02, ..., 53 | 7 |
1946
- * | Day of month | d | 1, 2, ..., 31 | |
1947
- * | | do | 1st, 2nd, ..., 31st | 7 |
1948
- * | | dd | 01, 02, ..., 31 | |
1949
- * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
1950
- * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
1951
- * | | DD | 01, 02, ..., 365, 366 | 9 |
1952
- * | | DDD | 001, 002, ..., 365, 366 | |
1953
- * | | DDDD | ... | 3 |
1954
- * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
1955
- * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1956
- * | | EEEEE | M, T, W, T, F, S, S | |
1957
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1958
- * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
1959
- * | | io | 1st, 2nd, ..., 7th | 7 |
1960
- * | | ii | 01, 02, ..., 07 | 7 |
1961
- * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
1962
- * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
1963
- * | | iiiii | M, T, W, T, F, S, S | 7 |
1964
- * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
1965
- * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
1966
- * | | eo | 2nd, 3rd, ..., 1st | 7 |
1967
- * | | ee | 02, 03, ..., 01 | |
1968
- * | | eee | Mon, Tue, Wed, ..., Sun | |
1969
- * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1970
- * | | eeeee | M, T, W, T, F, S, S | |
1971
- * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1972
- * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
1973
- * | | co | 2nd, 3rd, ..., 1st | 7 |
1974
- * | | cc | 02, 03, ..., 01 | |
1975
- * | | ccc | Mon, Tue, Wed, ..., Sun | |
1976
- * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1977
- * | | ccccc | M, T, W, T, F, S, S | |
1978
- * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1979
- * | AM, PM | a..aa | AM, PM | |
1980
- * | | aaa | am, pm | |
1981
- * | | aaaa | a.m., p.m. | 2 |
1982
- * | | aaaaa | a, p | |
1983
- * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
1984
- * | | bbb | am, pm, noon, midnight | |
1985
- * | | bbbb | a.m., p.m., noon, midnight | 2 |
1986
- * | | bbbbb | a, p, n, mi | |
1987
- * | Flexible day period | B..BBB | at night, in the morning, ... | |
1988
- * | | BBBB | at night, in the morning, ... | 2 |
1989
- * | | BBBBB | at night, in the morning, ... | |
1990
- * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
1991
- * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
1992
- * | | hh | 01, 02, ..., 11, 12 | |
1993
- * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
1994
- * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
1995
- * | | HH | 00, 01, 02, ..., 23 | |
1996
- * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
1997
- * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
1998
- * | | KK | 01, 02, ..., 11, 00 | |
1999
- * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2000
- * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2001
- * | | kk | 24, 01, 02, ..., 23 | |
2002
- * | Minute | m | 0, 1, ..., 59 | |
2003
- * | | mo | 0th, 1st, ..., 59th | 7 |
2004
- * | | mm | 00, 01, ..., 59 | |
2005
- * | Second | s | 0, 1, ..., 59 | |
2006
- * | | so | 0th, 1st, ..., 59th | 7 |
2007
- * | | ss | 00, 01, ..., 59 | |
2008
- * | Fraction of second | S | 0, 1, ..., 9 | |
2009
- * | | SS | 00, 01, ..., 99 | |
2010
- * | | SSS | 000, 001, ..., 999 | |
2011
- * | | SSSS | ... | 3 |
2012
- * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2013
- * | | XX | -0800, +0530, Z | |
2014
- * | | XXX | -08:00, +05:30, Z | |
2015
- * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2016
- * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2017
- * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2018
- * | | xx | -0800, +0530, +0000 | |
2019
- * | | xxx | -08:00, +05:30, +00:00 | 2 |
2020
- * | | xxxx | -0800, +0530, +0000, +123456 | |
2021
- * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2022
- * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2023
- * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2024
- * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2025
- * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2026
- * | Seconds timestamp | t | 512969520 | 7 |
2027
- * | | tt | ... | 3,7 |
2028
- * | Milliseconds timestamp | T | 512969520900 | 7 |
2029
- * | | TT | ... | 3,7 |
2030
- * | Long localized date | P | 04/29/1453 | 7 |
2031
- * | | PP | Apr 29, 1453 | 7 |
2032
- * | | PPP | April 29th, 1453 | 7 |
2033
- * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2034
- * | Long localized time | p | 12:00 AM | 7 |
2035
- * | | pp | 12:00:00 AM | 7 |
2036
- * | | ppp | 12:00:00 AM GMT+2 | 7 |
2037
- * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2038
- * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2039
- * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2040
- * | | PPPppp | April 29th, 1453 at ... | 7 |
2041
- * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2042
- * Notes:
2043
- * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2044
- * are the same as "stand-alone" units, but are different in some languages.
2045
- * "Formatting" units are declined according to the rules of the language
2046
- * in the context of a date. "Stand-alone" units are always nominative singular:
2047
- *
2048
- * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2049
- *
2050
- * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2051
- *
2052
- * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2053
- * the single quote characters (see below).
2054
- * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2055
- * the output will be the same as default pattern for this unit, usually
2056
- * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2057
- * are marked with "2" in the last column of the table.
2058
- *
2059
- * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2060
- *
2061
- * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2062
- *
2063
- * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2064
- *
2065
- * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2066
- *
2067
- * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2068
- *
2069
- * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2070
- * The output will be padded with zeros to match the length of the pattern.
2071
- *
2072
- * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2073
- *
2074
- * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2075
- * These tokens represent the shortest form of the quarter.
2076
- *
2077
- * 5. The main difference between `y` and `u` patterns are B.C. years:
2078
- *
2079
- * | Year | `y` | `u` |
2080
- * |------|-----|-----|
2081
- * | AC 1 | 1 | 1 |
2082
- * | BC 1 | 1 | 0 |
2083
- * | BC 2 | 2 | -1 |
2084
- *
2085
- * Also `yy` always returns the last two digits of a year,
2086
- * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2087
- *
2088
- * | Year | `yy` | `uu` |
2089
- * |------|------|------|
2090
- * | 1 | 01 | 01 |
2091
- * | 14 | 14 | 14 |
2092
- * | 376 | 76 | 376 |
2093
- * | 1453 | 53 | 1453 |
2094
- *
2095
- * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2096
- * except local week-numbering years are dependent on `options.weekStartsOn`
2097
- * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2098
- * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2099
- *
2100
- * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2101
- * so right now these tokens fall back to GMT timezones.
2102
- *
2103
- * 7. These patterns are not in the Unicode Technical Standard #35:
2104
- * - `i`: ISO day of week
2105
- * - `I`: ISO week of year
2106
- * - `R`: ISO week-numbering year
2107
- * - `t`: seconds timestamp
2108
- * - `T`: milliseconds timestamp
2109
- * - `o`: ordinal number modifier
2110
- * - `P`: long localized date
2111
- * - `p`: long localized time
2112
- *
2113
- * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2114
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2115
- *
2116
- * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2117
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2118
- *
2119
- * @param {Date|Number} date - the original date
2120
- * @param {String} format - the string of tokens
2121
- * @param {Object} [options] - an object with options.
2122
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2123
- * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2124
- * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2125
- * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2126
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2127
- * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2128
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2129
- * @returns {String} the formatted date string
2130
- * @throws {TypeError} 2 arguments required
2131
- * @throws {RangeError} `date` must not be Invalid Date
2132
- * @throws {RangeError} `options.locale` must contain `localize` property
2133
- * @throws {RangeError} `options.locale` must contain `formatLong` property
2134
- * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2135
- * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2136
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2137
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2138
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2139
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2140
- * @throws {RangeError} format string contains an unescaped latin alphabet character
2141
- *
2142
- * @example
2143
- * // Represent 11 February 2014 in middle-endian format:
2144
- * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2145
- * //=> '02/11/2014'
2146
- *
2147
- * @example
2148
- * // Represent 2 July 2014 in Esperanto:
2149
- * import { eoLocale } from 'date-fns/locale/eo'
2150
- * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2151
- * locale: eoLocale
2152
- * })
2153
- * //=> '2-a de julio 2014'
2154
- *
2155
- * @example
2156
- * // Escape string by single quote characters:
2157
- * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2158
- * //=> "3 o'clock"
2159
- */
2160
-
2161
- function format(dirtyDate, dirtyFormatStr, options) {
2162
- var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2163
- requiredArgs(2, arguments);
2164
- var formatStr = String(dirtyFormatStr);
2165
- var defaultOptions = getDefaultOptions();
2166
- var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2167
- var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2168
-
2169
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2170
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2171
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2172
- }
2173
- var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2174
-
2175
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2176
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2177
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2178
- }
2179
- if (!locale.localize) {
2180
- throw new RangeError('locale must contain localize property');
2181
- }
2182
- if (!locale.formatLong) {
2183
- throw new RangeError('locale must contain formatLong property');
2184
- }
2185
- var originalDate = toDate(dirtyDate);
2186
- if (!isValid(originalDate)) {
2187
- throw new RangeError('Invalid time value');
2188
- }
2189
-
2190
- // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2191
- // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2192
- // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2193
- var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2194
- var utcDate = subMilliseconds(originalDate, timezoneOffset);
2195
- var formatterOptions = {
2196
- firstWeekContainsDate: firstWeekContainsDate,
2197
- weekStartsOn: weekStartsOn,
2198
- locale: locale,
2199
- _originalDate: originalDate
2200
- };
2201
- var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2202
- var firstCharacter = substring[0];
2203
- if (firstCharacter === 'p' || firstCharacter === 'P') {
2204
- var longFormatter = longFormatters$1[firstCharacter];
2205
- return longFormatter(substring, locale.formatLong);
2206
- }
2207
- return substring;
2208
- }).join('').match(formattingTokensRegExp).map(function (substring) {
2209
- // Replace two single quote characters with one single quote character
2210
- if (substring === "''") {
2211
- return "'";
2212
- }
2213
- var firstCharacter = substring[0];
2214
- if (firstCharacter === "'") {
2215
- return cleanEscapedString(substring);
2216
- }
2217
- var formatter = formatters$1[firstCharacter];
2218
- if (formatter) {
2219
- if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2220
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2221
- }
2222
- if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2223
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2224
- }
2225
- return formatter(utcDate, substring, locale.localize, formatterOptions);
2226
- }
2227
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2228
- throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2229
- }
2230
- return substring;
2231
- }).join('');
2232
- return result;
2233
- }
2234
- function cleanEscapedString(input) {
2235
- var matched = input.match(escapedStringRegExp);
2236
- if (!matched) {
2237
- return input;
2238
- }
2239
- return matched[1].replace(doubleQuoteRegExp, "'");
2240
- }
69
+ const timezone = timezone$1.exports;
2241
70
 
2242
71
  const customClockCss = ".CustomClockContainer.sc-custom-clock.sc-custom-clock{display:flex;justify-content:center;align-items:center}.CustomClockContainer.sc-custom-clock.sc-custom-clock p.sc-custom-clock{font-size:16px}";
2243
72
  const CustomClockStyle0 = customClockCss;
@@ -2247,10 +76,18 @@ const CustomClock = class {
2247
76
  registerInstance(this, hostRef);
2248
77
  this.startClock = () => {
2249
78
  this.intervalId = setInterval(() => {
2250
- this.timeString = format(new Date(), this.clockFormat);
79
+ if (this.timeZone.length > 0) {
80
+ dayjs.extend(utc);
81
+ dayjs.extend(timezone);
82
+ this.timeString = dayjs().tz(this.timeZone).format(this.clockFormat);
83
+ }
84
+ else {
85
+ this.timeString = dayjs().format(this.clockFormat);
86
+ }
2251
87
  }, 1000);
2252
88
  };
2253
- this.clockFormat = 'hh:MM a';
89
+ this.clockFormat = 'HH:mm:ss';
90
+ this.timeZone = '';
2254
91
  this.translationUrl = '';
2255
92
  this.language = 'en';
2256
93
  this.timeString = '';
@@ -2270,7 +107,7 @@ const CustomClock = class {
2270
107
  clearInterval(this.intervalId);
2271
108
  }
2272
109
  render() {
2273
- return (h("div", { key: '35cc9ba979bdc24b138d98d94f5a68139b126634', class: "CustomClockContainer" }, h("p", { key: '49654823c681d720bdb2beca7516395afadfe123' }, translate('currentTime', this.language), ": ", this.timeString)));
110
+ return (h("div", { key: 'a5f785406272352dfe1797105d524c042ff03b41', class: "CustomClockContainer" }, h("p", { key: '8e9ebfae2f06a4297af2f39210e8687bc6c141b4' }, translate('currentTime', this.language), ": ", this.timeString)));
2274
111
  }
2275
112
  static get watchers() { return {
2276
113
  "translationUrl": ["handleNewTranslations"]