@fr0st/datetime 6.0.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DateTime=t()}(this,(function(){"use strict";const e={};function t(t,n){return t in e||(e[t]=n()),e[t]}function n(e){return t(`dateFormatter.${e}`,(t=>r("en",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"})))}function r(e,t){return new Intl.DateTimeFormat(e,{timeZone:"UTC",...t})}const i=(new Intl.DateTimeFormat).resolvedOptions(),s={clampDates:!0,defaultLocale:i.locale,defaultTimeZone:i.timeZone},o=/\s(?:UTC|GMT|Z|[\+\-]\d)|\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}\.\d{3}[\+\-]\d{2}\:\d{2}/i,u="eee MMM dd yyyy",a="yyyy-MM-dd'T'HH:mm:ss.SSSxxx",f="eee MMM dd yyyy HH:mm:ss xx (VV)",c="HH:mm:ss xx (VV)",h=/([a-z])\1*|'[^']*'/i,l=[31,28,31,30,31,30,31,31,30,31,30,31],d=/(?:GMT)?([\+\-])(\d{2})(\:?)(\d{2})?/,g=[["year","weekYear"],["era"],["quarter","month","week","dayOfYear"],["weekOfMonth"],["date","weekDay"],["weekDayInMonth"],["hours24","hours12","dayPeriod"],["minutes","seconds","milliseconds"]],m={year:"diffInYears",month:"diffInMonths",week:"diffInWeeks",day:"diffInDays",hour:"diffInHours",minute:"diffInMinutes",second:"diffInSeconds"},y={month:12,week:null,day:7,hour:24,minute:60,second:60};function D(e,t,n,r=!0){switch(t=t.setTimeZone(e.getTimeZone()),n){case"year":return k(e,t.setYear(e.getYear()),e.getYear()-t.getYear(),!r,-1);case"month":return k(e,t.setYear(e.getYear(),e.getMonth()),12*(e.getYear()-t.getYear())+e.getMonth()-t.getMonth(),!r,-1);case"week":return k(e,t.setWeekYear(e.getWeekYear(),e.getWeek()),(e-t)/6048e5,r);case"day":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()),(e-t)/864e5,r);case"hour":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours()),(e-t)/36e5,r);case"minute":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours(),e.getMinutes()),(e-t)/6e4,r);case"second":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(e-t)/1e3,r);default:throw new Error("Invalid time unit supplied")}}function k(e,t,n,r=!0,i=1){return n>0?(n=Math.floor(n),r&&e<t&&(n+=i)):n<0&&(n=Math.ceil(n),r&&e>t&&(n-=i)),n}function M(e){const t=e.getTimeZone();if("UTC"===t)return 0;const r=n("UTC").format(e),i=n(t).format(e);return(new Date(r)-new Date(i))/6e4}function T(e){return e.getTime()-6e4*e.getTimeZoneOffset()}function p(e,t){let n=0;for(const r of e){if(r!==t[n])throw new Error(`Unmatched character in DateTime string: ${r}`);n++}}function w(e,t){const n=e.getTimeZoneOffset(),r=t+6e4*n,i=e.setTime(r),s=i.getTimeZoneOffset();return n===s?i:i.setTime(r-6e4*(n-s))}function I(e,n="long"){return t(`periods.${e}.${n}`,(t=>{const n=r(e,{hour:"numeric",hourCycle:"h11"});return new Array(2).fill().map(((e,t)=>n.formatToParts(Date.UTC(2018,0,1,12*t)).find((e=>"dayPeriod"===e.type)).value))}))}function Y(e,n="long",i=!0){return t(`days.${e}.${n}.${i}`,(t=>{if(i){const t=r(e,{weekday:n});return new Array(7).fill().map(((e,n)=>t.format(Date.UTC(2018,0,n))))}const s=r(e,{year:"numeric",month:"numeric",day:"numeric",weekday:n});return new Array(7).fill().map(((e,t)=>s.formatToParts(Date.UTC(2018,0,t)).find((e=>"weekday"===e.type)).value))}))}function O(e,n="long"){return t(`eras.${e}.${n}`,(t=>{const i=r(e,{era:n});return new Array(2).fill().map(((e,t)=>i.formatToParts(Date.UTC(t-1,0,1)).find((e=>"era"===e.type)).value))}))}function S(e,n="long",i=!0){return t(`months.${e}.${n}.${i}`,(t=>{if(i){const t=r(e,{month:n});return new Array(12).fill().map(((e,n)=>t.format(Date.UTC(2018,n,1))))}const s=r(e,{year:"numeric",month:n,day:"numeric"});return new Array(12).fill().map(((e,t)=>s.formatToParts(Date.UTC(2018,t,1)).find((e=>"month"===e.type)).value))}))}function Z(e){return t(`numbers.${e}`,(t=>{const n=r(e,{minute:"numeric"});return new Array(10).fill().map(((e,t)=>n.format(Date.UTC(2018,0,1,0,t))))}))}function W(e){return`(?:${Z(e).join("|")})+`}function L(e,t,n="long",r=!0){return Y(e,n,r)[t]}function H(e,t,n="long",r=!0){return S(e,n,r)[t-1]}function b(e,t,n=0){const r=Z(e);return`${t}`.padStart(n,0).replace(/\d/g,(e=>r[e]))}function x(e,t=!0,n=!1){const r=Math.abs(e/60|0),i=Math.abs(e%60),s=e>0?"-":"+",o=`${r}`.padStart(2,0),u=i||!n?`${i}`.padStart(2,0):"";return`${s}${o}${t&&u?":":""}${u}`}function C(e,n,r){const i=function(e){return"RelativeTimeFormat"in Intl?t(`relativeFormatter.${e}`,(t=>new Intl.RelativeTimeFormat(e,{numeric:"auto",style:"long"}))):null}(e);if(!i)throw new Error("RelativeTimeFormat not supported");return i.format(n,r)}class U{constructor(e=null,t={}){let n,r=!1;if(null===e)n=Date.now();else if(!isNaN(parseInt(e))&&isFinite(e))n=e;else{if(e!==`${e}`)throw new Error("Invalid date supplied");if(n=Date.parse(e),isNaN(n))throw new Error("Invalid date string supplied");e.match(o)||(n-=6e4*(new Date).getTimezoneOffset()),r=!0}this._date=new Date(n),this._dynamicTz=!1,this.isValid=!0;let i=t.timeZone;i||(i=s.defaultTimeZone),["Z","GMT"].includes(i)&&(i="UTC");const u=i.match(d);if(u?(this._offset=60*u[2]+parseInt(u[4]||0),this._offset&&"+"===u[1]&&(this._offset*=-1),this._offset?this._timeZone=x(this._offset):(this._dynamicTz=!0,this._timeZone="UTC")):(this._dynamicTz=!0,this._timeZone=i),this._dynamicTz&&(this._offset=M(this)),r&&this._offset){const e=this._offset;this._date.setTime(this.getTime()+6e4*this._offset),this._dynamicTz&&(this._offset=M(this),e!==this._offset&&this._date.setTime(this.getTime()-6e4*(e-offset)))}"locale"in t||(t.locale=s.defaultLocale),this._locale=t.locale}getLocale(){return this._locale}getTime(){return this._date.getTime()}getTimeZone(){return this._timeZone}getTimeZoneOffset(){return this._offset}setLocale(e){return new U(this.getTime(),{locale:e,timeZone:this._timeZone})}setTime(e){return new U(e,{locale:this._locale,timeZone:this._timeZone})}setTimeZone(e){return new U(this.getTime(),{locale:this._locale,timeZone:e})}setTimeZoneOffset(e){return new U(this.getTime(),{locale:this._locale,timeZone:x(e)})}valueOf(){return this.getTime()}[Symbol.toPrimitive](e){return"number"===e?this.valueOf():this.toString()}}const A={1:["af","am","ar-il","ar-sa","ar-ye","as","bn","bo","brx","ccp","ceb","chr","dav","dz","ebu","en","fil","gu","guz","haw","he","hi","id","ii","ja","jv","kam","ki","kln","km","kn","ko","kok","ks","lkt","lo","luo","luy","mas","mer","mgh","ml","mr","mt","my","nd","ne","om","or","pa","ps-pk","pt","qu","saq","sd","seh","sn","ta","te","th","ti","ug","ur","xh","yue","zh","zu"],7:["ar","ckb","en-ae","en-sd","fa","kab","lrc","mzn","ps"]},v={4:["ast","bg","br","ca","ce","cs","cy","da","de","dsb","el","en-at","en-be","en-ch","en-de","en-dk","en-fi","en-fj","en-gb","en-gg","en-gi","en-ie","en-im","en-je","en-nl","en-se","es","et","eu","fi","fo","fr","fur","fy","ga","gd","gl","gsw","gv","hsb","hu","is","it","ksh","kw","lb","lt","nb","nds","nl","nn","os-ru","pl","pt-ch","pt-lu","pt-pt","rm","ru","sah","se","sk","smn","sv","tt","wae"]};function $(e){switch(e){case 5:return"narrow";case 4:return"long";default:return"short"}}function _(e){return t(`minimumDays.${e}`,(t=>{let n=1;const r=e.toLowerCase().split("-");for(;1===n&&r.length;){for(const e in v)if({}.hasOwnProperty.call(v,e)&&v[e].includes(r.join("-"))){n=parseInt(e);break}r.pop()}return n}))}function B(e,n){return(7+parseInt(n)-function(e){return t(`weekStartOffset.${e}`,(t=>{let n;const r=e.toLowerCase().split("-");for(;!n&&r.length;){for(const e in A)if({}.hasOwnProperty.call(A,e)&&A[e].includes(r.join("-"))){n=parseInt(e);break}r.pop()}return n?n-2:0}))}(e))%7||7}function j(e,t,n="long",r=!0){return B(e,Y(e,n,r).indexOf(t)||7)}function z(e,t,n="long",r=!0){return S(e,n,r).indexOf(t)+1}function F(e,t){const n=Z(e);return parseInt(`${t}`.replace(/./g,(e=>n.indexOf(e))))}var G={G:{key:"era",maxLength:5,regex:(e,t)=>O(e,$(t)).join("|"),input:(e,t,n)=>function(e,t,n="long"){return O(e,n).indexOf(t)}(e,t,$(n)),output:(e,t)=>{const n=$(t);return e.era(n)}},y:{key:"year",regex:e=>W(e),input:(e,t,n)=>(t=F(e,t),2!==n||2!==`${t}`.length?t:t>40?1900+t:2e3+t),output:(e,t)=>{let n=e.getYear();return 2===t&&(n=`${n}`.slice(-2)),b(e.getLocale(),Math.abs(n),t)}},Y:{key:"weekYear",regex:e=>W(e),input:(e,t,n)=>(t=F(e,t),2!==n||2!==`${t}`.length?t:t>40?1900+t:2e3+t),output:(e,t)=>{let n=e.getWeekYear();return 2===t&&(n=`${n}`.slice(-2)),b(e.getLocale(),Math.abs(n),t)}},Q:{key:"quarter",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getQuarter(),t)},q:{key:"quarter",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getQuarter(),t)},M:{key:"month",regex:(e,t)=>{switch(t){case 5:case 4:case 3:return S(e,$(t),!1).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return z(e,t,$(n),!1);default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale(),r=e.getMonth();switch(t){case 5:case 4:case 3:return H(n,r,$(t),!1);default:return b(n,r,t)}}},L:{key:"month",regex:(e,t)=>{switch(t){case 5:case 4:case 3:return S(e,$(t)).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return z(e,t,$(n));default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale(),r=e.getMonth();switch(t){case 5:case 4:case 3:return H(n,r,$(t));default:return b(n,r,t)}}},w:{key:"week",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getWeek(),t)},W:{key:"weekOfMonth",regex:e=>W(e),input:(e,t)=>F(e,t),output:e=>b(e.getLocale(),e.getWeekOfMonth())},d:{key:"date",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getDate(),t)},D:{key:"dayOfYear",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getDayOfYear(),t)},F:{key:"weekDayInMonth",regex:e=>W(e),input:(e,t)=>F(e,t),output:e=>b(e.getLocale(),e.getWeekDayInMonth())},E:{key:"weekDay",regex:(e,t)=>Y(e,$(t),!1).join("|"),input:(e,t,n)=>5===n?null:j(e,t,$(n),!1),output:(e,t)=>{const n=$(t);return L(e.getLocale(),e.getDay(),n,!1)}},e:{key:"weekDay",maxLength:5,regex:(e,t)=>{switch(t){case 5:case 4:case 3:return Y(e,$(t),!1).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return j(e,t,$(n),!1);default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale();switch(t){case 5:case 4:case 3:const r=$(t);return L(n,e.getDay(),r,!1);default:return b(n,e.getWeekDay(),t)}}},c:{key:"weekDay",maxLength:5,regex:(e,t)=>{switch(t){case 5:case 4:case 3:return Y(e,$(t)).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return j(e,t,$(n));default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale();switch(t){case 5:case 4:case 3:const r=$(t);return L(n,e.getDay(),r);default:return b(n,e.getWeekDay())}}},a:{key:"dayPeriod",regex:(e,t)=>I(e,$(t)).join("|"),input:(e,t,n)=>function(e,t,n="long"){return I(e,n).indexOf(t)}(e,t,$(n)),output:(e,t)=>{const n=$(t);return e.dayPeriod(n)}},h:{key:"hours12",regex:e=>W(e),input:(e,t)=>(12===(t=F(e,t))&&(t=0),t),output:(e,t)=>b(e.getLocale(),e.getHours()%12||12,t)},H:{key:"hours24",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getHours(),t)},K:{key:"hours12",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getHours()%12,t)},k:{key:"hours24",regex:e=>W(e),input:(e,t)=>(24===(t=F(e,t))&&(t=0),t),output:(e,t)=>b(e.getLocale(),e.getHours()||24,t)},m:{key:"minutes",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getMinutes(),t)},s:{key:"seconds",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getSeconds(),t)},S:{key:"milliseconds",regex:e=>W(e),input:e=>0,output:(e,t)=>b(e.getLocale(),`${Math.floor(1e3*e.getMilliseconds())}`.padEnd(t,"0").slice(0,t))},z:{output:(e,t)=>{5===t&&(t=1);const n=$(t);return e.timeZoneName(n)}},Z:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:return"[\\+\\-]\\d{2}\\:\\d{2}|Z";case 4:return"GMT[\\+\\-]\\d{2}\\:\\d{2}|GMT";default:return"[\\+\\-]\\d{4}"}},input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();let r=!0,i="";switch(t){case 5:if(!n)return"Z";break;case 4:if(i="GMT",!n)return i;break;default:r=!1}return i+x(n,r)}},O:{key:"timeZone",regex:(e,t)=>4===t?"GMT[\\+\\-]\\d{2}\\:\\d{2}|GMT":"GMT[\\+\\-]\\d{2}|GMT",input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();if(!n)return"GMT";let r=!1;return 4===t||(r=!0),"GMT"+x(n,!0,r)}},V:{key:"timeZone",regex:e=>"([a-zA-Z_/]+)",input:(e,t)=>t,output:e=>e.getTimeZone()},X:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:case 3:return"[\\+\\-]\\d{2}\\:\\d{2}|Z";case 4:case 2:return"[\\+\\-]\\d{4}|Z";default:return"[\\+\\-]\\d{2}(?:\\d{2})?|Z"}},input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();if(!n)return"Z";let r;switch(t){case 5:case 3:r=!0;break;default:r=!1}return x(n,r,1===t)}},x:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:case 3:return"[\\+\\-]\\d{2}\\:\\d{2}";case 4:case 2:return"[\\+\\-]\\d{4}";default:return"[\\+\\-]\\d{2}(?:\\d{2})?"}},input:(e,t)=>t,output:(e,t)=>{let n;switch(t){case 5:case 3:n=!0;break;default:n=!1}return x(e.getTimeZoneOffset(),n,1===t)}}};function P(e,t,n){return new Array(t-1).fill().reduce(((t,n,r)=>t+E(e,r+1)),n)}function E(e,t){const n=new Date(Date.UTC(e,t-1));return t=n.getUTCMonth(),l[t]+(1==t&&N(n.getUTCFullYear())?1:0)}function Q(e){return N(e)?366:365}function N(e){return 29===new Date(e,1,29).getDate()}U.dayOfYear=P,U.daysInMonth=E,U.daysInYear=Q,U.fromArray=function(e,t={}){const n=e.slice(0,3),r=e.slice(3);return n.length<3&&n.push(...new Array(3-n.length).fill(1)),r.length<4&&r.push(...new Array(4-r.length).fill(0)),new U(null,t).setTimestamp(0).setYear(...n).setHours(...r)},U.fromDate=function(e,t={}){return new U(e.getTime(),t)},U.fromFormat=function(e,t,n={}){"locale"in n||(n.locale=s.defaultLocale);const r=[];let i;for(;e&&(i=e.match(h));){const s=i[1],o=i.index,u=i[0].length;if(o&&p(e.substring(0,o),t),e=e.substring(o+u),t=t.substring(o),!s){const e=i[0].slice(1,-1);p(e||"'",t),t=t.substring(e.length);continue}if(!(s in G))throw new Error(`Invalid token in DateTime format: ${s}`);const a=G[s].regex(n.locale,u),f=t.match(new RegExp(`^${a}`));if(!f)throw new Error(`Unmatched token in DateTime string: ${s}`);const c=f[0],h=G[s].input(n.locale,c,u);if(null!==h){const e=G[s].key;r.push({key:e,value:h,literal:c,token:s,length:u})}t=t.substring(c.length)}e&&p(e,t),"timeZone"in n||(n.timeZone=s.defaultTimeZone);let o=n.timeZone;for(const{key:e,value:t}of r)"timeZone"===e&&(o=t);let u=this.fromTimestamp(0,{locale:n.locale}).setYear(1).setTimeZone(o);const a=function(){let e=!1,t=!0;return{date:{get:e=>e.getDate(),set:(e,t)=>e.setDate(t)},dayPeriod:{get:e=>e.getHours()<12?0:1,set:(n,r)=>{e=r;let i=r?12:0;return t&&(i+=n.getHours()),n.setHours(i)}},dayOfYear:{get:e=>e.getDayOfYear(),set:(e,t)=>e.setDayOfYear(t)},era:{get:e=>e.getYear()<1?0:1,set:(e,t)=>{const n=t?1:-1;return e.setYear(e.getYear()*n)}},hours12:{get:e=>e.getHours()%12,set:(n,r)=>(e&&(r+=12),t=!0,n.setHours(r))},hours24:{get:e=>e.getHours(),set:(e,n)=>(t=!1,e.setHours(n))},milliseconds:{get:e=>e.getMilliseconds(),set:(e,t)=>e.setMilliseconds(t)},minutes:{get:e=>e.getMinutes(),set:(e,t)=>e.setMinutes(t)},month:{get:e=>e.getMonth(),set:(e,t)=>e.setMonth(t)},quarter:{get:e=>e.getQuarter(),set:(e,t)=>e.setQuarter(t)},seconds:{get:e=>e.getSeconds(),set:(e,t)=>e.setSeconds(t)},week:{get:e=>e.getWeek(),set:(e,t)=>e.setWeek(t)},weekDay:{get:e=>e.getWeekDay(),set:(e,t)=>e.setWeekDay(t)},weekDayInMonth:{get:e=>e.getWeekDayInMonth(),set:(e,t)=>e.setWeekDayInMonth(t)},weekOfMonth:{get:e=>e.getWeekOfMonth(),set:(e,t)=>e.setWeekOfMonth(t)},weekYear:{get:e=>e.getWeekYear(),set:(e,t)=>e.setWeekYear(t)},year:{get:e=>{const t=e.getYear();return Math.abs(t)},set:(e,t)=>e.setYear(t)}}}(),f=[];for(const e of g)for(const t of e)if("era"!==t||r.find((e=>"year"===e.key)))for(const e of r){const{key:n,value:r,literal:i,token:s,length:o}=e;if(n===t){if(5===o&&["M","L","E","e","c"].includes(s)){const e=s.repeat(o);if(u.format(e)===i)continue}u=a[n].set(u,r),f.push(e)}}let c=!0;for(const{key:e,value:t}of f)if(e in a&&a[e].get(u)!==t){c=!1;break}return n.timeZone!==o&&(u=u.setTimeZone(n.timeZone)),u.isValid=c,u},U.fromISOString=function(e,t={}){let n=this.fromFormat(a,e,{locale:"en"});return"timeZone"in t&&(n=n.setTimeZone(t.timeZone)),"locale"in t&&(n=n.setLocale(t.locale)),n},U.fromTimestamp=function(e,t={}){return new U(null,t).setTimestamp(e)},U.getDefaultLocale=function(){return s.defaultLocale},U.getDefaultTimeZone=function(){return s.defaultTimeZone},U.isLeapYear=N,U.now=function(e={}){return new U(null,e)},U.setDateClamping=function(e){s.clampDates=e},U.setDefaultLocale=function(e){s.defaultLocale=e},U.setDefaultTimeZone=function(e){s.defaultTimeZone=e};const q=U.prototype;return q.addDay=function(){return this.addDays(1)},q.addDays=function(e){return this.setDate(this.getDate()+e)},q.addHour=function(){return this.addHours(1)},q.addHours=function(e){return this.setTime(this.getTime()+36e5*e)},q.addMinute=function(){return this.addMinutes(1)},q.addMinutes=function(e){return this.setTime(this.getTime()+6e4*e)},q.addMonth=function(){return this.addMonths(1)},q.addMonths=function(e){return this.setMonth(this.getMonth()+e)},q.addSecond=function(){return this.addSeconds(1)},q.addSeconds=function(e){return this.setTime(this.getTime()+1e3*e)},q.addWeek=function(){return this.addWeeks(1)},q.addWeeks=function(e){return this.setDate(this.getDate()+7*e)},q.addYear=function(){return this.addYears(1)},q.addYears=function(e){return this.setYear(this.getYear()+e)},q.dayName=function(e="long"){return L(this.getLocale(),this.getDay(),e)},q.dayPeriod=function(e="long"){return function(e,t,n="long"){return I(e,n)[t]}(this.getLocale(),this.getHours()<12?0:1,e)},q.daysInMonth=function(){return E(this.getYear(),this.getMonth())},q.daysInYear=function(){return Q(this.getYear())},q.diff=function(e){return this-e},q.diffInDays=function(e,{relative:t=!0}={}){return D(this,e,"day",t)},q.diffInHours=function(e,{relative:t=!0}={}){return D(this,e,"hour",t)},q.diffInMinutes=function(e,{relative:t=!0}={}){return D(this,e,"minute",t)},q.diffInMonths=function(e,{relative:t=!0}={}){return D(this,e,"month",t)},q.diffInSeconds=function(e,{relative:t=!0}={}){return D(this,e,"second",t)},q.diffInWeeks=function(e,{relative:t=!0}={}){return D(this,e,"week",t)},q.diffInYears=function(e,{relative:t=!0}={}){return D(this,e,"year",t)},q.endOfDay=function(){return this.setHours(23,59,59,999)},q.endOfHour=function(){return this.setMinutes(59,59,999)},q.endOfMinute=function(){return this.setSeconds(59,999)},q.endOfMonth=function(){return this.setDate(this.daysInMonth()).endOfDay()},q.endOfQuarter=function(){const e=3*this.getQuarter();return this.setMonth(e,E(this.getYear(),e)).endOfDay()},q.endOfSecond=function(){return this.setMilliseconds(999)},q.endOfWeek=function(){return this.setWeekDay(7).endOfDay()},q.endOfYear=function(){return this.setMonth(12,31).endOfDay()},q.era=function(e="long"){return function(e,t,n="long"){return O(e,n)[t]}(this.getLocale(),this.getYear()<0?0:1,e)},q.format=function(e){let t,n="";for(;e&&(t=e.match(h));){const r=t[1],i=t.index,s=t[0].length;if(i&&(n+=e.substring(0,i)),e=e.substring(i+s),r){if(!(r in G))throw new Error(`Invalid token in DateTime format: ${r}`);n+=G[r].output(this,s)}else n+=t[0].slice(1,-1)}return n+=e,n},q.getDate=function(){return new Date(T(this)).getUTCDate()},q.getDay=function(){return new Date(T(this)).getUTCDay()},q.getDayOfYear=function(){return P(this.getYear(),this.getMonth(),this.getDate())},q.getHours=function(){return new Date(T(this)).getUTCHours()},q.getMilliseconds=function(){return new Date(T(this)).getUTCMilliseconds()},q.getMinutes=function(){return new Date(T(this)).getUTCMinutes()},q.getMonth=function(){return new Date(T(this)).getUTCMonth()+1},q.getQuarter=function(){return Math.ceil(this.getMonth()/3)},q.getSeconds=function(){return new Date(T(this)).getUTCSeconds()},q.getTimestamp=function(){return Math.floor(this.getTime()/1e3)},q.getWeek=function(){const e=this.startOfDay().setWeekDay(1),t=e.setWeek(1,1);return 1+((e-t)/6048e5|0)},q.getWeekDay=function(){return B(this.getLocale(),this.getDay())},q.getWeekDayInMonth=function(){const e=this.getWeek(),t=this.setDate(1),n=t.getWeek(),r=t.getWeekDay()>this.getWeekDay()?0:1;return n>e?e+r:e-n+r},q.getWeekOfMonth=function(){const e=this.getWeek(),t=this.setDate(1).getWeek();return t>e?e+1:e-t+1},q.getWeekYear=function(){const e=_(this.getLocale());return this.setWeekDay(7-e+1).getYear()},q.getYear=function(){return new Date(T(this)).getUTCFullYear()},q.humanDiff=function(e){const[t,n]=function(e,t){let n;for(const[r,i]of Object.entries(m)){const s=e[i](t);if(n&&y[r]&&Math.abs(s)>=y[r])return n;if(e[i](t,{relative:!1}))return[s,r];n=s?[s,r]:null}return n||[0,"second"]}(this,e);return C(this.getLocale(),t,n)},q.humanDiffInDays=function(e){return C(this.getLocale(),this.diffInDays(e),"day")},q.humanDiffInHours=function(e){return C(this.getLocale(),this.diffInHours(e),"hour")},q.humanDiffInMinutes=function(e){return C(this.getLocale(),this.diffInMinutes(e),"minute")},q.humanDiffInMonths=function(e){return C(this.getLocale(),this.diffInMonths(e),"month")},q.humanDiffInSeconds=function(e){return C(this.getLocale(),this.diffInSeconds(e),"second")},q.humanDiffInWeeks=function(e){return C(this.getLocale(),this.diffInWeeks(e),"week")},q.humanDiffInYears=function(e){return C(this.getLocale(),this.diffInYears(e),"year")},q.isAfter=function(e){return this.diff(e)>0},q.isAfterDay=function(e){return this.diffInDays(e)>0},q.isAfterHour=function(e){return this.diffInHours(e)>0},q.isAfterMinute=function(e){return this.diffInMinutes(e)>0},q.isAfterMonth=function(e){return this.diffInMonths(e)>0},q.isAfterSecond=function(e){return this.diffInSeconds(e)>0},q.isAfterWeek=function(e){return this.diffInWeeks(e)>0},q.isAfterYear=function(e){return this.diffInYears(e)>0},q.isBefore=function(e){return this.diff(e)<0},q.isBeforeDay=function(e){return this.diffInDays(e)<0},q.isBeforeHour=function(e){return this.diffInHours(e)<0},q.isBeforeMinute=function(e){return this.diffInMinutes(e)<0},q.isBeforeMonth=function(e){return this.diffInMonths(e)<0},q.isBeforeSecond=function(e){return this.diffInSeconds(e)<0},q.isBeforeWeek=function(e){return this.diffInWeeks(e)<0},q.isBeforeYear=function(e){return this.diffInYears(e)<0},q.isBetween=function(e,t){return this.isAfter(e)&&this.isBefore(t)},q.isBetweenDay=function(e,t){return this.isAfterDay(e)&&this.isBeforeDay(t)},q.isBetweenHour=function(e,t){return this.isAfterHour(e)&&this.isBeforeHour(t)},q.isBetweenMinute=function(e,t){return this.isAfterMinute(e)&&this.isBeforeMinute(t)},q.isBetweenMonth=function(e,t){return this.isAfterMonth(e)&&this.isBeforeMonth(t)},q.isBetweenSecond=function(e,t){return this.isAfterSecond(e)&&this.isBeforeSecond(t)},q.isBetweenWeek=function(e,t){return this.isAfterWeek(e)&&this.isBeforeWeek(t)},q.isBetweenYear=function(e,t){return this.isAfterYear(e)&&this.isBeforeYear(t)},q.isDST=function(){if(!this._dynamicTz)return!1;const e=this.getYear(),t=U.fromArray([e,1,1],{timeZone:this.getTimeZone()}),n=U.fromArray([e,6,1],{timeZone:this.getTimeZone()});return this.getTimeZoneOffset()<Math.max(t.getTimeZoneOffset(),n.getTimeZoneOffset())},q.isLeapYear=function(){return N(this.getYear())},q.isSame=function(e){return 0===this.diff(e)},q.isSameDay=function(e){return 0===this.diffInDays(e)},q.isSameHour=function(e){return 0===this.diffInHours(e)},q.isSameMinute=function(e){return 0===this.diffInMinutes(e)},q.isSameMonth=function(e){return 0===this.diffInMonths(e)},q.isSameSecond=function(e){return 0===this.diffInSeconds(e)},q.isSameWeek=function(e){return 0===this.diffInWeeks(e)},q.isSameYear=function(e){return 0===this.diffInYears(e)},q.isSameOrAfter=function(e){return this.diff(e)>=0},q.isSameOrAfterDay=function(e){return this.diffInDays(e)>=0},q.isSameOrAfterHour=function(e){return this.diffInHours(e)>=0},q.isSameOrAfterMinute=function(e){return this.diffInMinutes(e)>=0},q.isSameOrAfterMonth=function(e){return this.diffInMonths(e)>=0},q.isSameOrAfterSecond=function(e){return this.diffInSeconds(e)>=0},q.isSameOrAfterWeek=function(e){return this.diffInWeeks(e)>=0},q.isSameOrAfterYear=function(e){return this.diffInYears(e)>=0},q.isSameOrBefore=function(e){return this.diff(e)<=0},q.isSameOrBeforeDay=function(e){return this.diffInDays(e)<=0},q.isSameOrBeforeHour=function(e){return this.diffInHours(e)<=0},q.isSameOrBeforeMinute=function(e){return this.diffInMinutes(e)<=0},q.isSameOrBeforeMonth=function(e){return this.diffInMonths(e)<=0},q.isSameOrBeforeSecond=function(e){return this.diffInSeconds(e)<=0},q.isSameOrBeforeWeek=function(e){return this.diffInWeeks(e)<=0},q.isSameOrBeforeYear=function(e){return this.diffInYears(e)<=0},q.monthName=function(e="long"){return H(this.getLocale(),this.getMonth(),e)},q.setDate=function(e){return w(this,new Date(T(this)).setUTCDate(e))},q.setDay=function(e){return w(this,new Date(T(this)).setUTCDate(this.getDate()-this.getDay()+parseInt(e)))},q.setDayOfYear=function(e){return w(this,new Date(T(this)).setUTCMonth(0,e))},q.setHours=function(...e){return w(this,new Date(T(this)).setUTCHours(...e))},q.setMilliseconds=function(e){return w(this,new Date(T(this)).setUTCMilliseconds(e))},q.setMinutes=function(...e){return w(this,new Date(T(this)).setUTCMinutes(...e))},q.setMonth=function(e,t=null){return null===t&&(t=this.getDate(),s.clampDates&&(t=Math.min(t,E(this.getYear(),e)))),w(this,new Date(T(this)).setUTCMonth(e-1,t))},q.setQuarter=function(e){return w(this,new Date(T(this)).setUTCMonth(3*e-3))},q.setSeconds=function(...e){return w(this,new Date(T(this)).setUTCSeconds(...e))},q.setTimestamp=function(e){return this.setTime(1e3*e)},q.setWeek=function(e,t=null){null===t&&(t=this.getWeekDay());const n=_(this.getLocale());return this.setYear(this.getWeekYear(),1,n+7*(e-1)).setWeekDay(t)},q.setWeekDay=function(e){return w(this,new Date(T(this)).setUTCDate(this.getDate()-this.getWeekDay()+parseInt(e)))},q.setWeekDayInMonth=function(e){return this.setDate(this.getDate()+7*(e-this.getWeekDayInMonth()))},q.setWeekOfMonth=function(e){return this.setDate(this.getDate()+7*(e-this.getWeekOfMonth()))},q.setWeekYear=function(e,t=null,n=null){const r=_(this.getLocale());return null===t&&(t=Math.min(this.getWeek(),U.fromArray([e,1,r]).weeksInYear())),null===n&&(n=this.getWeekDay()),this.setYear(e,1,r+7*(t-1)).setWeekDay(n)},q.setYear=function(e,t=null,n=null){return null===t&&(t=this.getMonth()),null===n&&(n=this.getDate(),s.clampDates&&(n=Math.min(n,E(this.getYear(),t)))),w(this,new Date(T(this)).setUTCFullYear(e,t-1,n))},q.startOfDay=function(){return this.setHours(0,0,0,0)},q.startOfHour=function(){return this.setMinutes(0,0,0)},q.startOfMinute=function(){return this.setSeconds(0,0)},q.startOfMonth=function(){return this.setDate(1).startOfDay()},q.startOfQuarter=function(){const e=3*this.getQuarter()-2;return this.setMonth(e,1).startOfDay()},q.startOfSecond=function(){return this.setMilliseconds(0)},q.startOfWeek=function(){return this.setWeekDay(1).startOfDay()},q.startOfYear=function(){return this.setMonth(1,1).startOfDay()},q.subDay=function(){return this.addDays(-1)},q.subDays=function(e){return this.addDays(-e)},q.subHour=function(){return this.addHours(-1)},q.subHours=function(e){return this.addHours(-e)},q.subMinute=function(){return this.addMinutes(-1)},q.subMinutes=function(e){return this.addMinutes(-e)},q.subMonth=function(){return this.addMonths(-1)},q.subMonths=function(e){return this.addMonths(-e)},q.subSecond=function(){return this.addSeconds(-1)},q.subSeconds=function(e){return this.addSeconds(-e)},q.subWeek=function(){return this.addWeeks(-1)},q.subWeeks=function(e){return this.addWeeks(-e)},q.subYear=function(){return this.addYears(-1)},q.subYears=function(e){return this.addYears(-e)},q.timeZoneName=function(e="long"){return this._dynamicTz?function(e,t,n,i="long"){return r(e,{second:"numeric",timeZone:n,timeZoneName:i}).formatToParts(t).find((e=>"timeZoneName"===e.type)).value}(this.getLocale(),this.getTime(),this.getTimeZone(),e):"GMT"+x(this.getTimeZoneOffset(),!0,"short"===e)},q.toDateString=function(){return this.format(u)},q.toISOString=function(){return this.setLocale("en").setTimeZone("UTC").format(a)},q.toString=function(){return this.format(f)},q.toTimeString=function(){return this.format(c)},q.toUTCString=function(){return this.setLocale("en").setTimeZone("UTC").toString()},q.weeksInYear=function(){const e=_(this.getLocale());return this.setMonth(12,24+e).getWeek()},U}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DateTime=t()}(this,(function(){"use strict";const e={};function t(t,n){return t in e||(e[t]=n()),e[t]}function n(e){return t(`dateFormatter.${e}`,(t=>r("en",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"})))}function r(e,t){return new Intl.DateTimeFormat(e,{timeZone:"UTC",...t})}const i=(new Intl.DateTimeFormat).resolvedOptions(),s={clampDates:!0,defaultLocale:i.locale,defaultTimeZone:i.timeZone},o=/\s(?:UTC|GMT|Z|[\+\-]\d)|\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}\.\d{3}[\+\-]\d{2}\:\d{2}/i,u="eee MMM dd yyyy",a="yyyy-MM-dd'T'HH:mm:ss.SSSxxx",f="eee MMM dd yyyy HH:mm:ss xx (VV)",c="HH:mm:ss xx (VV)",h=/([a-z])\1*|'[^']*'/i,l=[31,28,31,30,31,30,31,31,30,31,30,31],d=/(?:GMT)?([\+\-])(\d{2})(\:?)(\d{2})?/,g=[["year","weekYear"],["era"],["quarter","month","week","dayOfYear"],["weekOfMonth"],["date","weekDay"],["weekDayInMonth"],["hours24","hours12","dayPeriod"],["minutes","seconds","milliseconds"]],m={year:"diffInYears",month:"diffInMonths",week:"diffInWeeks",day:"diffInDays",hour:"diffInHours",minute:"diffInMinutes",second:"diffInSeconds"},y={month:12,week:null,day:7,hour:24,minute:60,second:60};function D(e,t,n,r=!0){switch(t=t.setTimeZone(e.getTimeZone()),n){case"year":return k(e,t.setYear(e.getYear()),e.getYear()-t.getYear(),!r,-1);case"month":return k(e,t.setYear(e.getYear(),e.getMonth()),12*(e.getYear()-t.getYear())+e.getMonth()-t.getMonth(),!r,-1);case"week":return k(e,t.setWeekYear(e.getWeekYear(),e.getWeek()),(e-t)/6048e5,r);case"day":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()),(e-t)/864e5,r);case"hour":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours()),(e-t)/36e5,r);case"minute":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours(),e.getMinutes()),(e-t)/6e4,r);case"second":return k(e,t.setYear(e.getYear(),e.getMonth(),e.getDate()).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(e-t)/1e3,r);default:throw new Error("Invalid time unit supplied")}}function k(e,t,n,r=!0,i=1){return n>0?(n=Math.floor(n),r&&e<t&&(n+=i)):n<0&&(n=Math.ceil(n),r&&e>t&&(n-=i)),n}function M(e){const t=e.getTimeZone();if("UTC"===t)return 0;const r=n("UTC").format(e),i=n(t).format(e);return(new Date(r)-new Date(i))/6e4}function T(e){return e.getTime()-6e4*e.getTimeZoneOffset()}function p(e,t){let n=0;for(const r of e){if(r!==t[n])throw new Error(`Unmatched character in DateTime string: ${r}`);n++}}function w(e,t){const n=e.getTimeZoneOffset(),r=t+6e4*n,i=e.setTime(r),s=i.getTimeZoneOffset();return n===s?i:i.setTime(r-6e4*(n-s))}function I(e,n="long"){return t(`periods.${e}.${n}`,(t=>{const n=r(e,{hour:"numeric",hourCycle:"h11"});return new Array(2).fill().map(((e,t)=>n.formatToParts(Date.UTC(2018,0,1,12*t)).find((e=>"dayPeriod"===e.type)).value))}))}function Y(e,n="long",i=!0){return t(`days.${e}.${n}.${i}`,(t=>{if(i){const t=r(e,{weekday:n});return new Array(7).fill().map(((e,n)=>t.format(Date.UTC(2018,0,n))))}const s=r(e,{year:"numeric",month:"numeric",day:"numeric",weekday:n});return new Array(7).fill().map(((e,t)=>s.formatToParts(Date.UTC(2018,0,t)).find((e=>"weekday"===e.type)).value))}))}function O(e,n="long"){return t(`eras.${e}.${n}`,(t=>{const i=r(e,{era:n});return new Array(2).fill().map(((e,t)=>i.formatToParts(Date.UTC(t-1,0,1)).find((e=>"era"===e.type)).value))}))}function S(e,n="long",i=!0){return t(`months.${e}.${n}.${i}`,(t=>{if(i){const t=r(e,{month:n});return new Array(12).fill().map(((e,n)=>t.format(Date.UTC(2018,n,1))))}const s=r(e,{year:"numeric",month:n,day:"numeric"});return new Array(12).fill().map(((e,t)=>s.formatToParts(Date.UTC(2018,t,1)).find((e=>"month"===e.type)).value))}))}function Z(e){return t(`numbers.${e}`,(t=>{const n=r(e,{minute:"numeric"});return new Array(10).fill().map(((e,t)=>n.format(Date.UTC(2018,0,1,0,t))))}))}function W(e){return`(?:${Z(e).join("|")})+`}function L(e,t,n="long",r=!0){return Y(e,n,r)[t]}function H(e,t,n="long",r=!0){return S(e,n,r)[t-1]}function b(e,t,n=0){const r=Z(e);return`${t}`.padStart(n,0).replace(/\d/g,(e=>r[e]))}function x(e,t=!0,n=!1){const r=Math.abs(e/60|0),i=Math.abs(e%60),s=e>0?"-":"+",o=`${r}`.padStart(2,0),u=i||!n?`${i}`.padStart(2,0):"";return`${s}${o}${t&&u?":":""}${u}`}function C(e,n,r){const i=function(e){return"RelativeTimeFormat"in Intl?t(`relativeFormatter.${e}`,(t=>new Intl.RelativeTimeFormat(e,{numeric:"auto",style:"long"}))):null}(e);if(!i)throw new Error("RelativeTimeFormat not supported");return i.format(n,r)}class U{constructor(e=null,t={}){let n,r=!1;if(null===e)n=Date.now();else if(!isNaN(parseInt(e))&&isFinite(e))n=e;else{if(e!==`${e}`)throw new Error("Invalid date supplied");if(n=Date.parse(e),isNaN(n))throw new Error("Invalid date string supplied");e.match(o)||(n-=6e4*(new Date).getTimezoneOffset()),r=!0}this._date=new Date(n),this._dynamicTz=!1,this.isValid=!0;let i=t.timeZone;i||(i=s.defaultTimeZone),["Z","GMT"].includes(i)&&(i="UTC");const u=i.match(d);if(u?(this._offset=60*u[2]+parseInt(u[4]||0),this._offset&&"+"===u[1]&&(this._offset*=-1),this._offset?this._timeZone=x(this._offset):(this._dynamicTz=!0,this._timeZone="UTC")):(this._dynamicTz=!0,this._timeZone=i),this._dynamicTz&&(this._offset=M(this)),r&&this._offset){const e=this._offset;this._date.setTime(this.getTime()+6e4*this._offset),this._dynamicTz&&(this._offset=M(this),e!==this._offset&&this._date.setTime(this.getTime()-6e4*(e-offset)))}"locale"in t||(t.locale=s.defaultLocale),this._locale=t.locale}getLocale(){return this._locale}getTime(){return this._date.getTime()}getTimeZone(){return this._timeZone}getTimeZoneOffset(){return this._offset}setLocale(e){return new U(this.getTime(),{locale:e,timeZone:this._timeZone})}setTime(e){return new U(e,{locale:this._locale,timeZone:this._timeZone})}setTimeZone(e){return new U(this.getTime(),{locale:this._locale,timeZone:e})}setTimeZoneOffset(e){return new U(this.getTime(),{locale:this._locale,timeZone:x(e)})}valueOf(){return this.getTime()}[Symbol.toPrimitive](e){return"number"===e?this.valueOf():this.toString()}}const A={1:["af","am","ar-il","ar-sa","ar-ye","as","bn","bo","brx","ccp","ceb","chr","dav","dz","ebu","en","fil","gu","guz","haw","he","hi","id","ii","ja","jv","kam","ki","kln","km","kn","ko","kok","ks","lkt","lo","luo","luy","mas","mer","mgh","ml","mr","mt","my","nd","ne","om","or","pa","ps-pk","pt","qu","saq","sd","seh","sn","ta","te","th","ti","ug","ur","xh","yue","zh","zu"],7:["ar","ckb","en-ae","en-sd","fa","kab","lrc","mzn","ps"]},v={4:["ast","bg","br","ca","ce","cs","cy","da","de","dsb","el","en-at","en-be","en-ch","en-de","en-dk","en-fi","en-fj","en-gb","en-gg","en-gi","en-ie","en-im","en-je","en-nl","en-se","es","et","eu","fi","fo","fr","fur","fy","ga","gd","gl","gsw","gv","hsb","hu","is","it","ksh","kw","lb","lt","nb","nds","nl","nn","os-ru","pl","pt-ch","pt-lu","pt-pt","rm","ru","sah","se","sk","smn","sv","tt","wae"]};function $(e){switch(e){case 5:return"narrow";case 4:return"long";default:return"short"}}function _(e){return t(`minimumDays.${e}`,(t=>{let n=1;const r=e.toLowerCase().split("-");for(;1===n&&r.length;){for(const e in v)if({}.hasOwnProperty.call(v,e)&&v[e].includes(r.join("-"))){n=parseInt(e);break}r.pop()}return n}))}function B(e,n){return(7+parseInt(n)-function(e){return t(`weekStartOffset.${e}`,(t=>{let n;const r=e.toLowerCase().split("-");for(;!n&&r.length;){for(const e in A)if({}.hasOwnProperty.call(A,e)&&A[e].includes(r.join("-"))){n=parseInt(e);break}r.pop()}return n?n-2:0}))}(e))%7||7}function j(e,t,n="long",r=!0){return B(e,Y(e,n,r).indexOf(t)||7)}function z(e,t,n="long",r=!0){return S(e,n,r).indexOf(t)+1}function F(e,t){const n=Z(e);return parseInt(`${t}`.replace(/./g,(e=>n.indexOf(e))))}var G={G:{key:"era",maxLength:5,regex:(e,t)=>O(e,$(t)).join("|"),input:(e,t,n)=>function(e,t,n="long"){return O(e,n).indexOf(t)}(e,t,$(n)),output:(e,t)=>{const n=$(t);return e.era(n)}},y:{key:"year",regex:e=>W(e),input:(e,t,n)=>(t=F(e,t),2!==n||2!==`${t}`.length?t:t>40?1900+t:2e3+t),output:(e,t)=>{let n=e.getYear();return 2===t&&(n=`${n}`.slice(-2)),b(e.getLocale(),Math.abs(n),t)}},Y:{key:"weekYear",regex:e=>W(e),input:(e,t,n)=>(t=F(e,t),2!==n||2!==`${t}`.length?t:t>40?1900+t:2e3+t),output:(e,t)=>{let n=e.getWeekYear();return 2===t&&(n=`${n}`.slice(-2)),b(e.getLocale(),Math.abs(n),t)}},Q:{key:"quarter",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getQuarter(),t)},q:{key:"quarter",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getQuarter(),t)},M:{key:"month",regex:(e,t)=>{switch(t){case 5:case 4:case 3:return S(e,$(t),!1).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return z(e,t,$(n),!1);default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale(),r=e.getMonth();switch(t){case 5:case 4:case 3:return H(n,r,$(t),!1);default:return b(n,r,t)}}},L:{key:"month",regex:(e,t)=>{switch(t){case 5:case 4:case 3:return S(e,$(t)).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return z(e,t,$(n));default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale(),r=e.getMonth();switch(t){case 5:case 4:case 3:return H(n,r,$(t));default:return b(n,r,t)}}},w:{key:"week",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getWeek(),t)},W:{key:"weekOfMonth",regex:e=>W(e),input:(e,t)=>F(e,t),output:e=>b(e.getLocale(),e.getWeekOfMonth())},d:{key:"date",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getDate(),t)},D:{key:"dayOfYear",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getDayOfYear(),t)},F:{key:"weekDayInMonth",regex:e=>W(e),input:(e,t)=>F(e,t),output:e=>b(e.getLocale(),e.getWeekDayInMonth())},E:{key:"weekDay",regex:(e,t)=>Y(e,$(t),!1).join("|"),input:(e,t,n)=>5===n?null:j(e,t,$(n),!1),output:(e,t)=>{const n=$(t);return L(e.getLocale(),e.getDay(),n,!1)}},e:{key:"weekDay",maxLength:5,regex:(e,t)=>{switch(t){case 5:case 4:case 3:return Y(e,$(t),!1).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return j(e,t,$(n),!1);default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale();switch(t){case 5:case 4:case 3:const r=$(t);return L(n,e.getDay(),r,!1);default:return b(n,e.getWeekDay(),t)}}},c:{key:"weekDay",maxLength:5,regex:(e,t)=>{switch(t){case 5:case 4:case 3:return Y(e,$(t)).join("|");default:return W(e)}},input:(e,t,n)=>{switch(n){case 5:return null;case 4:case 3:return j(e,t,$(n));default:return F(e,t)}},output:(e,t)=>{const n=e.getLocale();switch(t){case 5:case 4:case 3:const r=$(t);return L(n,e.getDay(),r);default:return b(n,e.getWeekDay())}}},a:{key:"dayPeriod",regex:(e,t)=>I(e,$(t)).join("|"),input:(e,t,n)=>function(e,t,n="long"){return I(e,n).indexOf(t)}(e,t,$(n)),output:(e,t)=>{const n=$(t);return e.dayPeriod(n)}},h:{key:"hours12",regex:e=>W(e),input:(e,t)=>(12===(t=F(e,t))&&(t=0),t),output:(e,t)=>b(e.getLocale(),e.getHours()%12||12,t)},H:{key:"hours24",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getHours(),t)},K:{key:"hours12",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getHours()%12,t)},k:{key:"hours24",regex:e=>W(e),input:(e,t)=>(24===(t=F(e,t))&&(t=0),t),output:(e,t)=>b(e.getLocale(),e.getHours()||24,t)},m:{key:"minutes",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getMinutes(),t)},s:{key:"seconds",regex:e=>W(e),input:(e,t)=>F(e,t),output:(e,t)=>b(e.getLocale(),e.getSeconds(),t)},S:{key:"milliseconds",regex:e=>W(e),input:e=>0,output:(e,t)=>b(e.getLocale(),`${Math.floor(1e3*e.getMilliseconds())}`.padEnd(t,"0").slice(0,t))},z:{output:(e,t)=>{5===t&&(t=1);const n=$(t);return e.timeZoneName(n)}},Z:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:return"[\\+\\-]\\d{2}\\:\\d{2}|Z";case 4:return"GMT[\\+\\-]\\d{2}\\:\\d{2}|GMT";default:return"[\\+\\-]\\d{4}"}},input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();let r=!0,i="";switch(t){case 5:if(!n)return"Z";break;case 4:if(i="GMT",!n)return i;break;default:r=!1}return i+x(n,r)}},O:{key:"timeZone",regex:(e,t)=>4===t?"GMT[\\+\\-]\\d{2}\\:\\d{2}|GMT":"GMT[\\+\\-]\\d{2}|GMT",input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();if(!n)return"GMT";let r=!1;return 4===t||(r=!0),"GMT"+x(n,!0,r)}},V:{key:"timeZone",regex:e=>"([a-zA-Z_/]+)",input:(e,t)=>t,output:e=>e.getTimeZone()},X:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:case 3:return"[\\+\\-]\\d{2}\\:\\d{2}|Z";case 4:case 2:return"[\\+\\-]\\d{4}|Z";default:return"[\\+\\-]\\d{2}(?:\\d{2})?|Z"}},input:(e,t)=>t,output:(e,t)=>{const n=e.getTimeZoneOffset();if(!n)return"Z";let r;switch(t){case 5:case 3:r=!0;break;default:r=!1}return x(n,r,1===t)}},x:{key:"timeZone",regex:(e,t)=>{switch(t){case 5:case 3:return"[\\+\\-]\\d{2}\\:\\d{2}";case 4:case 2:return"[\\+\\-]\\d{4}";default:return"[\\+\\-]\\d{2}(?:\\d{2})?"}},input:(e,t)=>t,output:(e,t)=>{let n;switch(t){case 5:case 3:n=!0;break;default:n=!1}return x(e.getTimeZoneOffset(),n,1===t)}}};function P(e,t,n){return new Array(t-1).fill().reduce(((t,n,r)=>t+E(e,r+1)),n)}function E(e,t){const n=new Date(Date.UTC(e,t-1));return t=n.getUTCMonth(),l[t]+(1==t&&N(n.getUTCFullYear())?1:0)}function Q(e){return N(e)?366:365}function N(e){return 29===new Date(e,1,29).getDate()}U.dayOfYear=P,U.daysInMonth=E,U.daysInYear=Q,U.fromArray=function(e,t={}){const n=e.slice(0,3),r=e.slice(3);return n.length<3&&n.push(...new Array(3-n.length).fill(1)),r.length<4&&r.push(...new Array(4-r.length).fill(0)),new U(null,t).setTimestamp(0).setYear(...n).setHours(...r)},U.fromDate=function(e,t={}){return new U(e.getTime(),t)},U.fromFormat=function(e,t,n={}){"locale"in n||(n.locale=s.defaultLocale);const r=[];let i;for(;e&&(i=e.match(h));){const s=i[1],o=i.index,u=i[0].length;if(o&&p(e.substring(0,o),t),e=e.substring(o+u),t=t.substring(o),!s){const e=i[0].slice(1,-1);p(e||"'",t),t=t.substring(e.length);continue}if(!(s in G))throw new Error(`Invalid token in DateTime format: ${s}`);const a=G[s].regex(n.locale,u),f=t.match(new RegExp(`^${a}`));if(!f)throw new Error(`Unmatched token in DateTime string: ${s}`);const c=f[0],h=G[s].input(n.locale,c,u);if(null!==h){const e=G[s].key;r.push({key:e,value:h,literal:c,token:s,length:u})}t=t.substring(c.length)}e&&p(e,t),"timeZone"in n||(n.timeZone=s.defaultTimeZone);let o=n.timeZone;for(const{key:e,value:t}of r)"timeZone"===e&&(o=t);let u=this.fromTimestamp(0,{locale:n.locale}).setTimeZone(o);const a=function(){let e=!1,t=!0;return{date:{get:e=>e.getDate(),set:(e,t)=>e.setDate(t)},dayPeriod:{get:e=>e.getHours()<12?0:1,set:(n,r)=>{e=r;let i=r?12:0;return t&&(i+=n.getHours()),n.setHours(i)}},dayOfYear:{get:e=>e.getDayOfYear(),set:(e,t)=>e.setDayOfYear(t)},era:{get:e=>e.getYear()<1?0:1,set:(e,t)=>{const n=t?1:-1;return e.setYear(e.getYear()*n)}},hours12:{get:e=>e.getHours()%12,set:(n,r)=>(e&&(r+=12),t=!0,n.setHours(r))},hours24:{get:e=>e.getHours(),set:(e,n)=>(t=!1,e.setHours(n))},milliseconds:{get:e=>e.getMilliseconds(),set:(e,t)=>e.setMilliseconds(t)},minutes:{get:e=>e.getMinutes(),set:(e,t)=>e.setMinutes(t)},month:{get:e=>e.getMonth(),set:(e,t)=>e.setMonth(t)},quarter:{get:e=>e.getQuarter(),set:(e,t)=>e.setQuarter(t)},seconds:{get:e=>e.getSeconds(),set:(e,t)=>e.setSeconds(t)},week:{get:e=>e.getWeek(),set:(e,t)=>e.setWeek(t)},weekDay:{get:e=>e.getWeekDay(),set:(e,t)=>e.setWeekDay(t)},weekDayInMonth:{get:e=>e.getWeekDayInMonth(),set:(e,t)=>e.setWeekDayInMonth(t)},weekOfMonth:{get:e=>e.getWeekOfMonth(),set:(e,t)=>e.setWeekOfMonth(t)},weekYear:{get:e=>e.getWeekYear(),set:(e,t)=>e.setWeekYear(t)},year:{get:e=>{const t=e.getYear();return Math.abs(t)},set:(e,t)=>e.setYear(t)}}}(),f=[];for(const e of g)for(const t of e)if("era"!==t||r.find((e=>"year"===e.key)))for(const e of r){const{key:n,value:r,literal:i,token:s,length:o}=e;if(n===t){if(5===o&&["M","L","E","e","c"].includes(s)){const e=s.repeat(o);if(u.format(e)===i)continue}u=a[n].set(u,r),f.push(e)}}let c=!0;for(const{key:e,value:t}of f)if(e in a&&a[e].get(u)!==t){c=!1;break}return n.timeZone!==o&&(u=u.setTimeZone(n.timeZone)),u.isValid=c,u},U.fromISOString=function(e,t={}){let n=this.fromFormat(a,e,{locale:"en"});return"timeZone"in t&&(n=n.setTimeZone(t.timeZone)),"locale"in t&&(n=n.setLocale(t.locale)),n},U.fromTimestamp=function(e,t={}){return new U(null,t).setTimestamp(e)},U.getDefaultLocale=function(){return s.defaultLocale},U.getDefaultTimeZone=function(){return s.defaultTimeZone},U.isLeapYear=N,U.now=function(e={}){return new U(null,e)},U.setDateClamping=function(e){s.clampDates=e},U.setDefaultLocale=function(e){s.defaultLocale=e},U.setDefaultTimeZone=function(e){s.defaultTimeZone=e};const q=U.prototype;return q.addDay=function(){return this.addDays(1)},q.addDays=function(e){return this.setDate(this.getDate()+e)},q.addHour=function(){return this.addHours(1)},q.addHours=function(e){return this.setTime(this.getTime()+36e5*e)},q.addMinute=function(){return this.addMinutes(1)},q.addMinutes=function(e){return this.setTime(this.getTime()+6e4*e)},q.addMonth=function(){return this.addMonths(1)},q.addMonths=function(e){return this.setMonth(this.getMonth()+e)},q.addSecond=function(){return this.addSeconds(1)},q.addSeconds=function(e){return this.setTime(this.getTime()+1e3*e)},q.addWeek=function(){return this.addWeeks(1)},q.addWeeks=function(e){return this.setDate(this.getDate()+7*e)},q.addYear=function(){return this.addYears(1)},q.addYears=function(e){return this.setYear(this.getYear()+e)},q.dayName=function(e="long"){return L(this.getLocale(),this.getDay(),e)},q.dayPeriod=function(e="long"){return function(e,t,n="long"){return I(e,n)[t]}(this.getLocale(),this.getHours()<12?0:1,e)},q.daysInMonth=function(){return E(this.getYear(),this.getMonth())},q.daysInYear=function(){return Q(this.getYear())},q.diff=function(e){return this-e},q.diffInDays=function(e,{relative:t=!0}={}){return D(this,e,"day",t)},q.diffInHours=function(e,{relative:t=!0}={}){return D(this,e,"hour",t)},q.diffInMinutes=function(e,{relative:t=!0}={}){return D(this,e,"minute",t)},q.diffInMonths=function(e,{relative:t=!0}={}){return D(this,e,"month",t)},q.diffInSeconds=function(e,{relative:t=!0}={}){return D(this,e,"second",t)},q.diffInWeeks=function(e,{relative:t=!0}={}){return D(this,e,"week",t)},q.diffInYears=function(e,{relative:t=!0}={}){return D(this,e,"year",t)},q.endOfDay=function(){return this.setHours(23,59,59,999)},q.endOfHour=function(){return this.setMinutes(59,59,999)},q.endOfMinute=function(){return this.setSeconds(59,999)},q.endOfMonth=function(){return this.setDate(this.daysInMonth()).endOfDay()},q.endOfQuarter=function(){const e=3*this.getQuarter();return this.setMonth(e,E(this.getYear(),e)).endOfDay()},q.endOfSecond=function(){return this.setMilliseconds(999)},q.endOfWeek=function(){return this.setWeekDay(7).endOfDay()},q.endOfYear=function(){return this.setMonth(12,31).endOfDay()},q.era=function(e="long"){return function(e,t,n="long"){return O(e,n)[t]}(this.getLocale(),this.getYear()<0?0:1,e)},q.format=function(e){let t,n="";for(;e&&(t=e.match(h));){const r=t[1],i=t.index,s=t[0].length;if(i&&(n+=e.substring(0,i)),e=e.substring(i+s),r){if(!(r in G))throw new Error(`Invalid token in DateTime format: ${r}`);n+=G[r].output(this,s)}else n+=t[0].slice(1,-1)}return n+=e,n},q.getDate=function(){return new Date(T(this)).getUTCDate()},q.getDay=function(){return new Date(T(this)).getUTCDay()},q.getDayOfYear=function(){return P(this.getYear(),this.getMonth(),this.getDate())},q.getHours=function(){return new Date(T(this)).getUTCHours()},q.getMilliseconds=function(){return new Date(T(this)).getUTCMilliseconds()},q.getMinutes=function(){return new Date(T(this)).getUTCMinutes()},q.getMonth=function(){return new Date(T(this)).getUTCMonth()+1},q.getQuarter=function(){return Math.ceil(this.getMonth()/3)},q.getSeconds=function(){return new Date(T(this)).getUTCSeconds()},q.getTimestamp=function(){return Math.floor(this.getTime()/1e3)},q.getWeek=function(){const e=this.startOfDay().setWeekDay(1),t=e.setWeek(1,1);return 1+((e-t)/6048e5|0)},q.getWeekDay=function(){return B(this.getLocale(),this.getDay())},q.getWeekDayInMonth=function(){const e=this.getWeek(),t=this.setDate(1),n=t.getWeek(),r=t.getWeekDay()>this.getWeekDay()?0:1;return n>e?e+r:e-n+r},q.getWeekOfMonth=function(){const e=this.getWeek(),t=this.setDate(1).getWeek();return t>e?e+1:e-t+1},q.getWeekYear=function(){const e=_(this.getLocale());return this.setWeekDay(7-e+1).getYear()},q.getYear=function(){return new Date(T(this)).getUTCFullYear()},q.humanDiff=function(e){const[t,n]=function(e,t){let n;for(const[r,i]of Object.entries(m)){const s=e[i](t);if(n&&y[r]&&Math.abs(s)>=y[r])return n;if(e[i](t,{relative:!1}))return[s,r];n=s?[s,r]:null}return n||[0,"second"]}(this,e);return C(this.getLocale(),t,n)},q.humanDiffInDays=function(e){return C(this.getLocale(),this.diffInDays(e),"day")},q.humanDiffInHours=function(e){return C(this.getLocale(),this.diffInHours(e),"hour")},q.humanDiffInMinutes=function(e){return C(this.getLocale(),this.diffInMinutes(e),"minute")},q.humanDiffInMonths=function(e){return C(this.getLocale(),this.diffInMonths(e),"month")},q.humanDiffInSeconds=function(e){return C(this.getLocale(),this.diffInSeconds(e),"second")},q.humanDiffInWeeks=function(e){return C(this.getLocale(),this.diffInWeeks(e),"week")},q.humanDiffInYears=function(e){return C(this.getLocale(),this.diffInYears(e),"year")},q.isAfter=function(e){return this.diff(e)>0},q.isAfterDay=function(e){return this.diffInDays(e)>0},q.isAfterHour=function(e){return this.diffInHours(e)>0},q.isAfterMinute=function(e){return this.diffInMinutes(e)>0},q.isAfterMonth=function(e){return this.diffInMonths(e)>0},q.isAfterSecond=function(e){return this.diffInSeconds(e)>0},q.isAfterWeek=function(e){return this.diffInWeeks(e)>0},q.isAfterYear=function(e){return this.diffInYears(e)>0},q.isBefore=function(e){return this.diff(e)<0},q.isBeforeDay=function(e){return this.diffInDays(e)<0},q.isBeforeHour=function(e){return this.diffInHours(e)<0},q.isBeforeMinute=function(e){return this.diffInMinutes(e)<0},q.isBeforeMonth=function(e){return this.diffInMonths(e)<0},q.isBeforeSecond=function(e){return this.diffInSeconds(e)<0},q.isBeforeWeek=function(e){return this.diffInWeeks(e)<0},q.isBeforeYear=function(e){return this.diffInYears(e)<0},q.isBetween=function(e,t){return this.isAfter(e)&&this.isBefore(t)},q.isBetweenDay=function(e,t){return this.isAfterDay(e)&&this.isBeforeDay(t)},q.isBetweenHour=function(e,t){return this.isAfterHour(e)&&this.isBeforeHour(t)},q.isBetweenMinute=function(e,t){return this.isAfterMinute(e)&&this.isBeforeMinute(t)},q.isBetweenMonth=function(e,t){return this.isAfterMonth(e)&&this.isBeforeMonth(t)},q.isBetweenSecond=function(e,t){return this.isAfterSecond(e)&&this.isBeforeSecond(t)},q.isBetweenWeek=function(e,t){return this.isAfterWeek(e)&&this.isBeforeWeek(t)},q.isBetweenYear=function(e,t){return this.isAfterYear(e)&&this.isBeforeYear(t)},q.isDST=function(){if(!this._dynamicTz)return!1;const e=this.getYear(),t=U.fromArray([e,1,1],{timeZone:this.getTimeZone()}),n=U.fromArray([e,6,1],{timeZone:this.getTimeZone()});return this.getTimeZoneOffset()<Math.max(t.getTimeZoneOffset(),n.getTimeZoneOffset())},q.isLeapYear=function(){return N(this.getYear())},q.isSame=function(e){return 0===this.diff(e)},q.isSameDay=function(e){return 0===this.diffInDays(e)},q.isSameHour=function(e){return 0===this.diffInHours(e)},q.isSameMinute=function(e){return 0===this.diffInMinutes(e)},q.isSameMonth=function(e){return 0===this.diffInMonths(e)},q.isSameSecond=function(e){return 0===this.diffInSeconds(e)},q.isSameWeek=function(e){return 0===this.diffInWeeks(e)},q.isSameYear=function(e){return 0===this.diffInYears(e)},q.isSameOrAfter=function(e){return this.diff(e)>=0},q.isSameOrAfterDay=function(e){return this.diffInDays(e)>=0},q.isSameOrAfterHour=function(e){return this.diffInHours(e)>=0},q.isSameOrAfterMinute=function(e){return this.diffInMinutes(e)>=0},q.isSameOrAfterMonth=function(e){return this.diffInMonths(e)>=0},q.isSameOrAfterSecond=function(e){return this.diffInSeconds(e)>=0},q.isSameOrAfterWeek=function(e){return this.diffInWeeks(e)>=0},q.isSameOrAfterYear=function(e){return this.diffInYears(e)>=0},q.isSameOrBefore=function(e){return this.diff(e)<=0},q.isSameOrBeforeDay=function(e){return this.diffInDays(e)<=0},q.isSameOrBeforeHour=function(e){return this.diffInHours(e)<=0},q.isSameOrBeforeMinute=function(e){return this.diffInMinutes(e)<=0},q.isSameOrBeforeMonth=function(e){return this.diffInMonths(e)<=0},q.isSameOrBeforeSecond=function(e){return this.diffInSeconds(e)<=0},q.isSameOrBeforeWeek=function(e){return this.diffInWeeks(e)<=0},q.isSameOrBeforeYear=function(e){return this.diffInYears(e)<=0},q.monthName=function(e="long"){return H(this.getLocale(),this.getMonth(),e)},q.setDate=function(e){return w(this,new Date(T(this)).setUTCDate(e))},q.setDay=function(e){return w(this,new Date(T(this)).setUTCDate(this.getDate()-this.getDay()+parseInt(e)))},q.setDayOfYear=function(e){return w(this,new Date(T(this)).setUTCMonth(0,e))},q.setHours=function(...e){return w(this,new Date(T(this)).setUTCHours(...e))},q.setMilliseconds=function(e){return w(this,new Date(T(this)).setUTCMilliseconds(e))},q.setMinutes=function(...e){return w(this,new Date(T(this)).setUTCMinutes(...e))},q.setMonth=function(e,t=null){return null===t&&(t=this.getDate(),s.clampDates&&(t=Math.min(t,E(this.getYear(),e)))),w(this,new Date(T(this)).setUTCMonth(e-1,t))},q.setQuarter=function(e){return w(this,new Date(T(this)).setUTCMonth(3*e-3))},q.setSeconds=function(...e){return w(this,new Date(T(this)).setUTCSeconds(...e))},q.setTimestamp=function(e){return this.setTime(1e3*e)},q.setWeek=function(e,t=null){null===t&&(t=this.getWeekDay());const n=_(this.getLocale());return this.setYear(this.getWeekYear(),1,n+7*(e-1)).setWeekDay(t)},q.setWeekDay=function(e){return w(this,new Date(T(this)).setUTCDate(this.getDate()-this.getWeekDay()+parseInt(e)))},q.setWeekDayInMonth=function(e){return this.setDate(this.getDate()+7*(e-this.getWeekDayInMonth()))},q.setWeekOfMonth=function(e){return this.setDate(this.getDate()+7*(e-this.getWeekOfMonth()))},q.setWeekYear=function(e,t=null,n=null){const r=_(this.getLocale());return null===t&&(t=Math.min(this.getWeek(),U.fromArray([e,1,r]).weeksInYear())),null===n&&(n=this.getWeekDay()),this.setYear(e,1,r+7*(t-1)).setWeekDay(n)},q.setYear=function(e,t=null,n=null){return null===t&&(t=this.getMonth()),null===n&&(n=this.getDate(),s.clampDates&&(n=Math.min(n,E(this.getYear(),t)))),w(this,new Date(T(this)).setUTCFullYear(e,t-1,n))},q.startOfDay=function(){return this.setHours(0,0,0,0)},q.startOfHour=function(){return this.setMinutes(0,0,0)},q.startOfMinute=function(){return this.setSeconds(0,0)},q.startOfMonth=function(){return this.setDate(1).startOfDay()},q.startOfQuarter=function(){const e=3*this.getQuarter()-2;return this.setMonth(e,1).startOfDay()},q.startOfSecond=function(){return this.setMilliseconds(0)},q.startOfWeek=function(){return this.setWeekDay(1).startOfDay()},q.startOfYear=function(){return this.setMonth(1,1).startOfDay()},q.subDay=function(){return this.addDays(-1)},q.subDays=function(e){return this.addDays(-e)},q.subHour=function(){return this.addHours(-1)},q.subHours=function(e){return this.addHours(-e)},q.subMinute=function(){return this.addMinutes(-1)},q.subMinutes=function(e){return this.addMinutes(-e)},q.subMonth=function(){return this.addMonths(-1)},q.subMonths=function(e){return this.addMonths(-e)},q.subSecond=function(){return this.addSeconds(-1)},q.subSeconds=function(e){return this.addSeconds(-e)},q.subWeek=function(){return this.addWeeks(-1)},q.subWeeks=function(e){return this.addWeeks(-e)},q.subYear=function(){return this.addYears(-1)},q.subYears=function(e){return this.addYears(-e)},q.timeZoneName=function(e="long"){return this._dynamicTz?function(e,t,n,i="long"){return r(e,{second:"numeric",timeZone:n,timeZoneName:i}).formatToParts(t).find((e=>"timeZoneName"===e.type)).value}(this.getLocale(),this.getTime(),this.getTimeZone(),e):"GMT"+x(this.getTimeZoneOffset(),!0,"short"===e)},q.toDateString=function(){return this.format(u)},q.toISOString=function(){return this.setLocale("en").setTimeZone("UTC").format(a)},q.toString=function(){return this.format(f)},q.toTimeString=function(){return this.format(c)},q.toUTCString=function(){return this.setLocale("en").setTimeZone("UTC").toString()},q.weeksInYear=function(){const e=_(this.getLocale());return this.setMonth(12,24+e).getWeek()},U}));
|