@subrotosaha/datekit 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var F={name:"en",weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinal:r=>{let e=["th","st","nd","rd"],t=r%100;return r+(e[(t-20)%10]||e[t]||e[0])},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"}};var N={name:"es",weekdays:["Domingo","Lunes","Martes","Mi\xE9rcoles","Jueves","Viernes","S\xE1bado"],weekdaysShort:["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"],weekdaysMin:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],ordinal:r=>`${r}\xBA`,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xEDa",dd:"%d d\xEDas",M:"un mes",MM:"%d meses",y:"un a\xF1o",yy:"%d a\xF1os"},calendar:{sameDay:"[Hoy a las] LT",nextDay:"[Ma\xF1ana a las] LT",nextWeek:"dddd [a las] LT",lastDay:"[Ayer a las] LT",lastWeek:"[El] dddd [pasado a las] LT",sameElse:"L"}};var Y={en:F,es:N};function M(r){return Y[r]||Y.en}function $(r){Y[r.name]=r}function L(r,e,t="en"){let n=M(t),s=r.getUTCFullYear(),a=r.getUTCMonth(),o=r.getUTCDate(),i=r.getUTCHours(),d=r.getUTCMinutes(),c=r.getUTCSeconds(),h=r.getUTCMilliseconds(),m=r.getUTCDay(),u=new Date(Date.UTC(s,0,1)),f=Math.floor((r.getTime()-u.getTime())/864e5)+1,g=Math.floor(a/3)+1,D=B(r),O=new Map,p=new Map,w={YYYY:s.toString(),YY:s.toString().slice(-2),Qo:n.ordinal(g),Q:g.toString(),MMMM:n.months[a],MMM:n.monthsShort[a],Mo:n.ordinal(a+1),MM:(a+1).toString().padStart(2,"0"),M:(a+1).toString(),Wo:n.ordinal(D),WW:D.toString().padStart(2,"0"),W:D.toString(),DDDo:n.ordinal(f),DDDD:f.toString().padStart(3,"0"),DDD:f.toString(),Do:n.ordinal(o),DD:o.toString().padStart(2,"0"),D:o.toString(),dddd:n.weekdays[m],ddd:n.weekdaysShort[m],do:n.ordinal(m),dd:n.weekdaysMin[m],d:m.toString(),HH:i.toString().padStart(2,"0"),H:i.toString(),hh:(i%12||12).toString().padStart(2,"0"),h:(i%12||12).toString(),mm:d.toString().padStart(2,"0"),m:d.toString(),ss:c.toString().padStart(2,"0"),s:c.toString(),SSS:h.toString().padStart(3,"0"),SS:h.toString().padStart(2,"0").slice(0,2),S:Math.floor(h/100).toString(),A:i>=12?"PM":"AM",a:i>=12?"pm":"am",Z:W(r.getTimezoneOffset()),ZZ:W(r.getTimezoneOffset()).replace(":",""),X:Math.floor(r.getTime()/1e3).toString(),x:r.getTime().toString()},T=e;return Object.keys(w).sort((y,U)=>U.length-y.length).forEach((y,U)=>{let E=`\0${U}\0`,z=new RegExp(y,"g");T=T.replace(z,E),p.set(E,w[y])}),p.forEach((y,U)=>{T=T.replace(new RegExp(U,"g"),y)}),T}function B(r){let e=new Date(r.getTime());e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}function W(r){let e=r<=0?"+":"-",t=Math.abs(r),n=Math.floor(t/60),s=t%60;return`${e}${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`}function l(r){if(r instanceof Date)return new Date(r);if(typeof r=="number")return new Date(r);if(typeof r=="string")return new Date(r);throw new Error("Invalid date input")}function C(r){return r instanceof Date&&!isNaN(r.getTime())}function I(r,e="en",t=!1){let n=M(e),s=r<0,o=Math.abs(r)/1e3,i=o/60,d=i/60,c=d/24,h=c/30.44,m=c/365.25,u;return o<45?u=n.relativeTime.s:o<90?u=n.relativeTime.m:i<45?u=n.relativeTime.mm.replace("%d",Math.round(i).toString()):i<90?u=n.relativeTime.h:d<22?u=n.relativeTime.hh.replace("%d",Math.round(d).toString()):d<36?u=n.relativeTime.d:c<25?u=n.relativeTime.dd.replace("%d",Math.round(c).toString()):c<45?u=n.relativeTime.M:c<345?u=n.relativeTime.MM.replace("%d",Math.round(h).toString()):m<1.5?u=n.relativeTime.y:u=n.relativeTime.yy.replace("%d",Math.round(m).toString()),t?u:(s?n.relativeTime.future:n.relativeTime.past).replace("%s",u)}function v(r,e=new Date,t="en"){let n=M(t),s=new b(r),a=new b(e),o=s.startOf("day").diff(a.startOf("day").toDate(),"day"),i;return o===0?i=n.calendar.sameDay:o===1?i=n.calendar.nextDay:o===-1?i=n.calendar.lastDay:o>1&&o<=7?i=n.calendar.nextWeek:o<-1&&o>=-7?i=n.calendar.lastWeek:i=n.calendar.sameElse,i=i.replace("[","").replace("]","").replace("LT",s.format("HH:mm")).replace("L",s.format("MM/DD/YYYY")).replace("dddd",n.weekdays[r.getUTCDay()]),i}var H=[1,2,3,4,5];function k(r,e=[]){let t=r.getUTCDay();if(!H.includes(t))return!1;let n=r.toISOString().split("T")[0];return!e.some(s=>s.toISOString().split("T")[0]===n)}function x(r,e,t=[]){let n=new Date(r),s=Math.abs(e),a=e>0?1:-1;for(;s>0;)n.setUTCDate(n.getUTCDate()+a),k(n,t)&&s--;return n}function A(r,e,t=[]){let n=0,s=new Date(r),a=new Date(e);for(;s<=a;)k(s,t)&&n++,s.setUTCDate(s.getUTCDate()+1);return n}var S=class r{constructor(e,t="milliseconds"){typeof e=="number"?this._milliseconds=this.convertToMilliseconds(e,t):this._milliseconds=this.objectToMilliseconds(e)}convertToMilliseconds(e,t){return e*({milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5}[t]||1)}objectToMilliseconds(e){let t=0;return e.years&&(t+=e.years*365.25*864e5),e.months&&(t+=e.months*30.44*864e5),e.weeks&&(t+=e.weeks*6048e5),e.days&&(t+=e.days*864e5),e.hours&&(t+=e.hours*36e5),e.minutes&&(t+=e.minutes*6e4),e.seconds&&(t+=e.seconds*1e3),e.milliseconds&&(t+=e.milliseconds),t}asMilliseconds(){return this._milliseconds}asSeconds(){return this._milliseconds/1e3}asMinutes(){return this._milliseconds/6e4}asHours(){return this._milliseconds/36e5}asDays(){return this._milliseconds/864e5}asWeeks(){return this._milliseconds/6048e5}asMonths(){return this._milliseconds/(30.44*864e5)}asYears(){return this._milliseconds/(365.25*864e5)}humanize(e="en"){let t=Math.abs(this.asSeconds()),n=Math.abs(this.asMinutes()),s=Math.abs(this.asHours()),a=Math.abs(this.asDays()),o=Math.abs(this.asMonths()),i=Math.abs(this.asYears());return t<45?"a few seconds":t<90?"a minute":n<45?`${Math.round(n)} minutes`:n<90?"an hour":s<22?`${Math.round(s)} hours`:s<36?"a day":a<25?`${Math.round(a)} days`:a<45?"a month":a<345?`${Math.round(o)} months`:i<1.5?"a year":`${Math.round(i)} years`}toObject(){let e=Math.abs(this._milliseconds),t=Math.floor(e/(365.25*864e5));e-=t*365.25*864e5;let n=Math.floor(e/(30.44*864e5));e-=n*30.44*864e5;let s=Math.floor(e/864e5);e-=s*864e5;let a=Math.floor(e/36e5);e-=a*36e5;let o=Math.floor(e/6e4);e-=o*6e4;let i=Math.floor(e/1e3);e-=i*1e3;let d=Math.floor(e);return{years:t,months:n,days:s,hours:a,minutes:o,seconds:i,milliseconds:d}}add(e){return new r(this._milliseconds+e.asMilliseconds())}subtract(e){return new r(this._milliseconds-e.asMilliseconds())}static between(e,t){return new r(Math.abs(t.getTime()-e.getTime()))}};var b=class r{constructor(e,t){if(this.config={locale:"en",weekStartsOn:0,strictParsing:!1,...t},this.date=e?l(e):new Date,!C(this.date))throw new Error("Invalid date provided")}toDate(){return new Date(this.date)}toISOString(){return this.date.toISOString()}toUnix(){return Math.floor(this.date.getTime()/1e3)}valueOf(){return this.date.getTime()}toArray(){return[this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate(),this.date.getUTCHours(),this.date.getUTCMinutes(),this.date.getUTCSeconds(),this.date.getUTCMilliseconds()]}toObject(){return{year:this.date.getUTCFullYear(),month:this.date.getUTCMonth(),date:this.date.getUTCDate(),hour:this.date.getUTCHours(),minute:this.date.getUTCMinutes(),second:this.date.getUTCSeconds(),millisecond:this.date.getUTCMilliseconds()}}toJSON(){return this.toISOString()}toString(){return this.date.toString()}format(e){return L(this.date,e,this.config.locale)}static formatFromTimezoneString(e,t){let n,s;if(e instanceof Date?(s=e,n=e.toString()):typeof e=="number"?(s=new Date(e),n=s.toString()):(n=e,s=new Date(e)),isNaN(s.getTime()))throw new Error("Invalid date provided");let a=n.match(/GMT([+-]\d{2}):?(\d{2})|UTC([+-]\d{2}):?(\d{2})/i),o=0;if(a){let w=(a[1]||a[3])[0],T=parseInt((a[1]||a[3]).substring(1)),K=parseInt(a[2]||a[4]||"0");o=(T*60+K)*(w==="+"?1:-1)}else o=-s.getTimezoneOffset();let d=s.getTime()+o*60*1e3,c=new Date(d),h=c.getUTCFullYear(),m=c.getUTCMonth(),u=c.getUTCDate(),f=c.getUTCHours(),g=c.getUTCMinutes(),D=c.getUTCSeconds(),O=c.getUTCMilliseconds();return new r(Date.UTC(h,m,u,f,g,D,O)).format(t)}static formatZonedDate(e,t="DD-MM-YYYY",n="en"){let s,a;if(e instanceof Date?(a=e,s=e.toString()):typeof e=="number"?(a=new Date(e),s=a.toString()):(s=e,a=new Date(e)),isNaN(a.getTime()))throw new Error("Invalid date input for formatZonedDate");let o=s.match(/GMT([+-])(\d{2}):?(\d{2})/i),i=a;if(o){let d=o[1]==="-"?-1:1,c=parseInt(o[2],10),h=parseInt(o[3],10),m=d*(c*60+h),u=a.getTime()+m*6e4;i=new Date(u)}return L(i,t,n)}formatZonedDate(e,t="DD-MM-YYYY"){let n=this.config?.locale??"en";return r.formatZonedDate(e,t,n)}static convertTimezone(e,t,n,s){let a=l(e);if(!C(a))throw new Error("Invalid date provided");let o,i,d,c,h,m;if(typeof e=="string"&&!e.includes("Z")&&!e.includes("+")&&!e.includes("GMT")){let u=e.match(/(\d{4})-(\d{2})-(\d{2})[T\s](\d{2}):(\d{2}):(\d{2})/);u?(o=parseInt(u[1]),i=parseInt(u[2]),d=parseInt(u[3]),c=parseInt(u[4]),h=parseInt(u[5]),m=parseInt(u[6])):(o=a.getUTCFullYear(),i=a.getUTCMonth()+1,d=a.getUTCDate(),c=a.getUTCHours(),h=a.getUTCMinutes(),m=a.getUTCSeconds());let f=`${o}-${i.toString().padStart(2,"0")}-${d.toString().padStart(2,"0")}T${c.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`,g=new Date(Date.UTC(o,i-1,d,c,h,m)),D=new Date(g.toLocaleString("en-US",{timeZone:t})),O=new Date(g.toLocaleString("en-US",{timeZone:"UTC"})),p=D.getTime()-O.getTime(),w=g.getTime()-p,T=new Date(w);return r.formatInTimezone(T,n,s)}else return r.formatInTimezone(a,n,s)}static formatInTimezone(e,t,n){let s=l(e);if(!C(s))throw new Error("Invalid date provided");let o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(s),i={};return o.forEach(c=>{c.type!=="literal"&&(i[c.type]=c.value)}),new r(Date.UTC(parseInt(i.year),parseInt(i.month)-1,parseInt(i.day),parseInt(i.hour),parseInt(i.minute),parseInt(i.second))).format(n)}static fromTimezone(e,t,n,s=0,a=0,o=0,i="UTC"){let d=`${e}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`,c=new Intl.DateTimeFormat("en-US",{timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),h=new Date(d),m=new Date(Date.UTC(e,t-1,n,s,a,o)),u=new Date(m.toLocaleString("en-US",{timeZone:i})),f=new Date(m.toLocaleString("en-US",{timeZone:"UTC"})),g=u.getTime()-f.getTime(),D=m.getTime()-g;return new r(D)}static getTimezoneOffset(e,t=new Date){let n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:e})).getTime()-n.getTime())/6e4}year(){return this.date.getUTCFullYear()}month(){return this.date.getUTCMonth()}getDate(){return this.date.getUTCDate()}day(){return this.date.getUTCDay()}hour(){return this.date.getUTCHours()}minute(){return this.date.getUTCMinutes()}second(){return this.date.getUTCSeconds()}millisecond(){return this.date.getUTCMilliseconds()}quarter(){return Math.floor(this.date.getUTCMonth()/3)+1}week(){return this.isoWeek()}isoWeek(){let e=new Date(this.date.getTime());e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}weekday(){return(this.date.getUTCDay()+7-this.config.weekStartsOn)%7}isoWeekday(){return this.date.getUTCDay()||7}dayOfYear(){let e=new Date(Date.UTC(this.date.getUTCFullYear(),0,1));return Math.floor((this.date.getTime()-e.getTime())/864e5)+1}weekYear(){let e=new Date(this.date.getTime());return e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7)),e.getUTCFullYear()}set(e){let t=new Date(this.date);return e.year!==void 0&&t.setUTCFullYear(e.year),e.month!==void 0&&t.setUTCMonth(e.month),e.date!==void 0&&t.setUTCDate(e.date),e.hour!==void 0&&t.setUTCHours(e.hour),e.minute!==void 0&&t.setUTCMinutes(e.minute),e.second!==void 0&&t.setUTCSeconds(e.second),e.millisecond!==void 0&&t.setUTCMilliseconds(e.millisecond),new r(t,this.config)}setYear(e){return this.set({year:e})}setMonth(e){return this.set({month:e})}setDate(e){return this.set({date:e})}setHour(e){return this.set({hour:e})}setMinute(e){return this.set({minute:e})}setSecond(e){return this.set({second:e})}setMillisecond(e){return this.set({millisecond:e})}setQuarter(e){let t=(e-1)*3;return this.set({month:t})}add(e,t){let n=new Date(this.date);switch(t){case"millisecond":n.setUTCMilliseconds(n.getUTCMilliseconds()+e);break;case"second":n.setUTCSeconds(n.getUTCSeconds()+e);break;case"minute":n.setUTCMinutes(n.getUTCMinutes()+e);break;case"hour":n.setUTCHours(n.getUTCHours()+e);break;case"day":n.setUTCDate(n.getUTCDate()+e);break;case"week":n.setUTCDate(n.getUTCDate()+e*7);break;case"month":n.setUTCMonth(n.getUTCMonth()+e);break;case"quarter":n.setUTCMonth(n.getUTCMonth()+e*3);break;case"year":n.setUTCFullYear(n.getUTCFullYear()+e);break}return new r(n,this.config)}subtract(e,t){return this.add(-e,t)}startOf(e){let t=new Date(this.date);switch(e){case"year":t.setUTCMonth(0);case"quarter":if(e==="quarter"){let a=this.quarter();t.setUTCMonth((a-1)*3)}case"month":t.setUTCDate(1);case"day":t.setUTCHours(0);case"hour":t.setUTCMinutes(0);case"minute":t.setUTCSeconds(0);case"second":t.setUTCMilliseconds(0);break;case"week":let n=t.getUTCDay(),s=(n<this.config.weekStartsOn?7:0)+n-this.config.weekStartsOn;t.setUTCDate(t.getUTCDate()-s),t.setUTCHours(0,0,0,0);break}return new r(t,this.config)}endOf(e){return this.startOf(e).add(1,e).subtract(1,"millisecond")}isBefore(e,t){return t?this.startOf(t).valueOf()<new r(e).startOf(t).valueOf():this.date.getTime()<l(e).getTime()}isAfter(e,t){return t?this.startOf(t).valueOf()>new r(e).startOf(t).valueOf():this.date.getTime()>l(e).getTime()}isSame(e,t){if(!t)return this.date.getTime()===l(e).getTime();let n=this.startOf(t),s=new r(e,this.config).startOf(t);return n.date.getTime()===s.date.getTime()}isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)}isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)}isBetween(e,t,n,s="()"){let a=n?new r(e).startOf(n).valueOf():l(e).getTime(),o=n?new r(t).startOf(n).valueOf():l(t).getTime(),i=n?this.startOf(n).valueOf():this.date.getTime(),d=s[0]==="["?i>=a:i>a,c=s[1]==="]"?i<=o:i<o;return d&&c}isToday(){return this.isSame(new Date,"day")}isTomorrow(){let e=new r().add(1,"day");return this.isSame(e.toDate(),"day")}isYesterday(){let e=new r().subtract(1,"day");return this.isSame(e.toDate(),"day")}isThisWeek(){return this.isSame(new Date,"week")}isThisMonth(){return this.isSame(new Date,"month")}isThisQuarter(){return this.isSame(new Date,"quarter")}isThisYear(){return this.isSame(new Date,"year")}isWeekend(){let e=this.date.getUTCDay();return e===0||e===6}isWeekday(){return!this.isWeekend()}isLeapYear(){let e=this.date.getUTCFullYear();return e%4===0&&e%100!==0||e%400===0}isDST(){let e=new Date(this.year(),0,1),t=new Date(this.year(),6,1),n=Math.max(e.getTimezoneOffset(),t.getTimezoneOffset());return this.date.getTimezoneOffset()<n}diff(e,t="millisecond",n=!1){let s=l(e),a=this.date.getTime()-s.getTime(),o=1;switch(t){case"millisecond":return a;case"second":o=1e3;break;case"minute":o=1e3*60;break;case"hour":o=1e3*60*60;break;case"day":o=1e3*60*60*24;break;case"week":o=1e3*60*60*24*7;break;case"month":return n?a/(1e3*60*60*24*30.436875):this.diffMonth(s);case"quarter":return n?a/(1e3*60*60*24*91.3125):Math.floor(this.diffMonth(s)/3);case"year":return n?a/(1e3*60*60*24*365.25):this.diffYear(s)}let i=a/o;return n?i:Math.floor(i)}diffMonth(e){let t=this.date.getUTCFullYear()-e.getUTCFullYear(),n=this.date.getUTCMonth()-e.getUTCMonth();return t*12+n}diffYear(e){return this.date.getUTCFullYear()-e.getUTCFullYear()}fromNow(e=!1){let t=Date.now()-this.date.getTime();return I(t,this.config.locale,e)}toNow(e=!1){let t=this.date.getTime()-Date.now();return I(t,this.config.locale,e)}from(e,t=!1){let n=l(e).getTime()-this.date.getTime();return I(n,this.config.locale,t)}to(e,t=!1){let n=this.date.getTime()-l(e).getTime();return I(n,this.config.locale,t)}calendar(e){let t=e?l(e):new Date;return v(this.date,t,this.config.locale)}duration(e){return e?S.between(this.date,l(e)):new S(this.date.getTime())}daysInMonth(){return new Date(Date.UTC(this.date.getUTCFullYear(),this.date.getUTCMonth()+1,0)).getUTCDate()}weeksInYear(){let e=new Date(Date.UTC(this.year(),11,31)),n=new r(e).isoWeek();return n===1?52:n}age(e){let t=e?l(e):new Date,n=this.date,s=t.getUTCFullYear()-n.getUTCFullYear(),a=n.getUTCMonth(),o=n.getUTCDate(),i=t.getUTCMonth(),d=t.getUTCDate();return(i<a||i===a&&d<o)&&s--,s}clone(){return new r(this.date,this.config)}isBusinessDay(e=[]){return k(this.date,e)}addBusinessDays(e,t=[]){return new r(x(this.date,e,t),this.config)}subtractBusinessDays(e,t=[]){return new r(x(this.date,-e,t),this.config)}businessDaysUntil(e,t=[]){return A(this.date,l(e),t)}locale(e){return e===void 0?this.config.locale:new r(this.date,{...this.config,locale:e})}static eachDayOfInterval(e){let t=new r(e.start),n=new r(e.end),s=[],a=t.clone();for(;a.isSameOrBefore(n.toDate(),"day");)s.push(a.clone()),a=a.add(1,"day");return s}static eachWeekOfInterval(e){let t=new r(e.start).startOf("week"),n=new r(e.end),s=[],a=t.clone();for(;a.isSameOrBefore(n.toDate(),"week");)s.push(a.clone()),a=a.add(1,"week");return s}static eachMonthOfInterval(e){let t=new r(e.start).startOf("month"),n=new r(e.end),s=[],a=t.clone();for(;a.isSameOrBefore(n.toDate(),"month");)s.push(a.clone()),a=a.add(1,"month");return s}static now(){return new r}static utc(e){return e?new r(e):new r(new Date)}static unix(e){return new r(e*1e3)}static isValid(e){try{return C(l(e))}catch{return!1}}static max(...e){let t=e.map(n=>l(n).getTime());return new r(Math.max(...t))}static min(...e){let t=e.map(n=>l(n).getTime());return new r(Math.min(...t))}static isDuration(e){return e instanceof S}static duration(e,t){return typeof e=="number"&&t?new S(e,t):new S(e)}};export{b as DateKit,S as Duration,F as en,N as es,M as getLocale,$ as registerLocale};
1
+ var H={name:"en",dir:"ltr",weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinal:n=>{let e=["th","st","nd","rd"],t=n%100;return n+(e[(t-20)%10]||e[t]||e[0])},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"}};var J={name:"es",dir:"ltr",weekdays:["Domingo","Lunes","Martes","Mi\xE9rcoles","Jueves","Viernes","S\xE1bado"],weekdaysShort:["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"],weekdaysMin:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],ordinal:n=>`${n}\xBA`,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xEDa",dd:"%d d\xEDas",M:"un mes",MM:"%d meses",y:"un a\xF1o",yy:"%d a\xF1os"},calendar:{sameDay:"[Hoy a las] LT",nextDay:"[Ma\xF1ana a las] LT",nextWeek:"dddd [a las] LT",lastDay:"[Ayer a las] LT",lastWeek:"[El] dddd [pasado a las] LT",sameElse:"L"}};var R={name:"fr",dir:"ltr",weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekdaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],weekdaysMin:["Di","Lu","Ma","Me","Je","Ve","Sa"],months:["Janvier","F\xE9vrier","Mars","Avril","Mai","Juin","Juillet","Ao\xFBt","Septembre","Octobre","Novembre","D\xE9cembre"],monthsShort:["Janv.","F\xE9vr.","Mars","Avr.","Mai","Juin","Juil.","Ao\xFBt","Sept.","Oct.","Nov.","D\xE9c."],ordinal:n=>n===1?`${n}er`:`${n}e`,relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},calendar:{sameDay:"[Aujourd'hui \xE0] LT",nextDay:"[Demain \xE0] LT",nextWeek:"dddd [\xE0] LT",lastDay:"[Hier \xE0] LT",lastWeek:"[Le] dddd [dernier \xE0] LT",sameElse:"L"}};var z={name:"de",dir:"ltr",weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],weekdaysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","M\xE4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],ordinal:n=>`${n}.`,relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},calendar:{sameDay:"[Heute um] LT [Uhr]",nextDay:"[Morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[Gestern um] LT [Uhr]",lastWeek:"[Letzten] dddd [um] LT [Uhr]",sameElse:"L"}};var Q={name:"ar",dir:"rtl",weekdays:["\u0627\u0644\u0623\u062D\u062F","\u0627\u0644\u0627\u062B\u0646\u064A\u0646","\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062E\u0645\u064A\u0633","\u0627\u0644\u062C\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062A"],weekdaysShort:["\u0623\u062D\u062F","\u0627\u062B\u0646\u064A\u0646","\u062B\u0644\u0627\u062B\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062E\u0645\u064A\u0633","\u062C\u0645\u0639\u0629","\u0633\u0628\u062A"],weekdaysMin:["\u062D","\u0646","\u062B","\u0631","\u062E","\u062C","\u0633"],months:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],monthsShort:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],ordinal:n=>`${n}`,relativeTime:{future:"\u0628\u0639\u062F %s",past:"\u0645\u0646\u0630 %s",s:"\u062B\u0648\u0627\u0646\u064D",m:"\u062F\u0642\u064A\u0642\u0629",mm:"%d \u062F\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062A",d:"\u064A\u0648\u0645",dd:"%d \u0623\u064A\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062A"},calendar:{sameDay:"[\u0627\u0644\u064A\u0648\u0645 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063A\u062F\u0627\u064B \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0627\u0644\u0645\u0627\u0636\u064A \u0639\u0646\u062F \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"}};var B={name:"zh",dir:"ltr",weekdays:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],weekdaysShort:["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"],weekdaysMin:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],months:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ordinal:n=>`\u7B2C${n}`,relativeTime:{future:"%s\u540E",past:"%s\u524D",s:"\u51E0\u79D2",m:"1 \u5206\u949F",mm:"%d \u5206\u949F",h:"1 \u5C0F\u65F6",hh:"%d \u5C0F\u65F6",d:"1 \u5929",dd:"%d \u5929",M:"1 \u4E2A\u6708",MM:"%d \u4E2A\u6708",y:"1 \u5E74",yy:"%d \u5E74"},calendar:{sameDay:"[\u4ECA\u5929] LT",nextDay:"[\u660E\u5929] LT",nextWeek:"dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4E0A] dddd LT",sameElse:"L"}};var P={name:"hi",dir:"ltr",weekdays:["\u0930\u0935\u093F\u0935\u093E\u0930","\u0938\u094B\u092E\u0935\u093E\u0930","\u092E\u0902\u0917\u0932\u0935\u093E\u0930","\u092C\u0941\u0927\u0935\u093E\u0930","\u0917\u0941\u0930\u0941\u0935\u093E\u0930","\u0936\u0941\u0915\u094D\u0930\u0935\u093E\u0930","\u0936\u0928\u093F\u0935\u093E\u0930"],weekdaysShort:["\u0930\u0935\u093F","\u0938\u094B\u092E","\u092E\u0902\u0917\u0932","\u092C\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094D\u0930","\u0936\u0928\u093F"],weekdaysMin:["\u0930","\u0938\u094B","\u092E","\u092C\u0941","\u0917\u0941","\u0936\u0941","\u0936"],months:["\u091C\u0928\u0935\u0930\u0940","\u092B\u093C\u0930\u0935\u0930\u0940","\u092E\u093E\u0930\u094D\u091A","\u0905\u092A\u094D\u0930\u0948\u0932","\u092E\u0908","\u091C\u0942\u0928","\u091C\u0941\u0932\u093E\u0908","\u0905\u0917\u0938\u094D\u0924","\u0938\u093F\u0924\u0902\u092C\u0930","\u0905\u0915\u094D\u091F\u0942\u092C\u0930","\u0928\u0935\u0902\u092C\u0930","\u0926\u093F\u0938\u0902\u092C\u0930"],monthsShort:["\u091C\u0928","\u092B\u093C\u0930","\u092E\u093E\u0930\u094D\u091A","\u0905\u092A\u094D\u0930","\u092E\u0908","\u091C\u0942\u0928","\u091C\u0941\u0932\u093E","\u0905\u0917","\u0938\u093F\u0924","\u0905\u0915\u094D\u091F","\u0928\u0935","\u0926\u093F\u0938"],ordinal:n=>`${n}\u0935\u093E\u0901`,relativeTime:{future:"%s \u092E\u0947\u0902",past:"%s \u092A\u0939\u0932\u0947",s:"\u0915\u0941\u091B \u0938\u0947\u0915\u0902\u0921",m:"\u090F\u0915 \u092E\u093F\u0928\u091F",mm:"%d \u092E\u093F\u0928\u091F",h:"\u090F\u0915 \u0918\u0902\u091F\u093E",hh:"%d \u0918\u0902\u091F\u0947",d:"\u090F\u0915 \u0926\u093F\u0928",dd:"%d \u0926\u093F\u0928",M:"\u090F\u0915 \u092E\u0939\u0940\u0928\u093E",MM:"%d \u092E\u0939\u0940\u0928\u0947",y:"\u090F\u0915 \u0938\u093E\u0932",yy:"%d \u0938\u093E\u0932"},calendar:{sameDay:"[\u0906\u091C] LT [\u092C\u091C\u0947]",nextDay:"[\u0915\u0932] LT [\u092C\u091C\u0947]",nextWeek:"dddd [\u0915\u094B] LT [\u092C\u091C\u0947]",lastDay:"[\u0915\u0932] LT [\u092C\u091C\u0947]",lastWeek:"[\u092A\u093F\u091B\u0932\u0947] dddd [\u0915\u094B] LT [\u092C\u091C\u0947]",sameElse:"L"}};var Z={name:"bn",dir:"ltr",weekdays:["\u09B0\u09AC\u09BF\u09AC\u09BE\u09B0","\u09B8\u09CB\u09AE\u09AC\u09BE\u09B0","\u09AE\u0999\u09CD\u0997\u09B2\u09AC\u09BE\u09B0","\u09AC\u09C1\u09A7\u09AC\u09BE\u09B0","\u09AC\u09C3\u09B9\u09B8\u09CD\u09AA\u09A4\u09BF\u09AC\u09BE\u09B0","\u09B6\u09C1\u0995\u09CD\u09B0\u09AC\u09BE\u09B0","\u09B6\u09A8\u09BF\u09AC\u09BE\u09B0"],weekdaysShort:["\u09B0\u09AC\u09BF","\u09B8\u09CB\u09AE","\u09AE\u0999\u09CD\u0997\u09B2","\u09AC\u09C1\u09A7","\u09AC\u09C3\u09B9\u09B8\u09CD\u09AA\u09A4\u09BF","\u09B6\u09C1\u0995\u09CD\u09B0","\u09B6\u09A8\u09BF"],weekdaysMin:["\u09B0","\u09B8\u09CB","\u09AE","\u09AC\u09C1","\u09AC\u09C3","\u09B6\u09C1","\u09B6"],months:["\u099C\u09BE\u09A8\u09C1\u09AF\u09BC\u09BE\u09B0\u09BF","\u09AB\u09C7\u09AC\u09CD\u09B0\u09C1\u09AF\u09BC\u09BE\u09B0\u09BF","\u09AE\u09BE\u09B0\u09CD\u099A","\u098F\u09AA\u09CD\u09B0\u09BF\u09B2","\u09AE\u09C7","\u099C\u09C1\u09A8","\u099C\u09C1\u09B2\u09BE\u0987","\u0986\u0997\u09B8\u09CD\u099F","\u09B8\u09C7\u09AA\u09CD\u099F\u09C7\u09AE\u09CD\u09AC\u09B0","\u0985\u0995\u09CD\u099F\u09CB\u09AC\u09B0","\u09A8\u09AD\u09C7\u09AE\u09CD\u09AC\u09B0","\u09A1\u09BF\u09B8\u09C7\u09AE\u09CD\u09AC\u09B0"],monthsShort:["\u099C\u09BE\u09A8","\u09AB\u09C7\u09AC","\u09AE\u09BE\u09B0\u09CD\u099A","\u098F\u09AA\u09CD\u09B0","\u09AE\u09C7","\u099C\u09C1\u09A8","\u099C\u09C1\u09B2\u09BE","\u0986\u0997","\u09B8\u09C7\u09AA\u09CD\u099F","\u0985\u0995\u09CD\u099F","\u09A8\u09AD\u09C7","\u09A1\u09BF\u09B8\u09C7"],ordinal:n=>`${n}\u09A4\u09AE`,relativeTime:{future:"%s \u09AA\u09B0\u09C7",past:"%s \u0986\u0997\u09C7",s:"\u0995\u09AF\u09BC\u09C7\u0995 \u09B8\u09C7\u0995\u09C7\u09A8\u09CD\u09A1",m:"\u098F\u0995 \u09AE\u09BF\u09A8\u09BF\u099F",mm:"%d \u09AE\u09BF\u09A8\u09BF\u099F",h:"\u098F\u0995 \u0998\u09A3\u09CD\u099F\u09BE",hh:"%d \u0998\u09A3\u09CD\u099F\u09BE",d:"\u098F\u0995 \u09A6\u09BF\u09A8",dd:"%d \u09A6\u09BF\u09A8",M:"\u098F\u0995 \u09AE\u09BE\u09B8",MM:"%d \u09AE\u09BE\u09B8",y:"\u098F\u0995 \u09AC\u099B\u09B0",yy:"%d \u09AC\u099B\u09B0"},calendar:{sameDay:"[\u0986\u099C] LT [\u09B8\u09AE\u09AF\u09BC]",nextDay:"[\u0986\u0997\u09BE\u09AE\u09C0\u0995\u09BE\u09B2] LT [\u09B8\u09AE\u09AF\u09BC]",nextWeek:"dddd [\u098F] LT [\u09B8\u09AE\u09AF\u09BC]",lastDay:"[\u0997\u09A4\u0995\u09BE\u09B2] LT [\u09B8\u09AE\u09AF\u09BC]",lastWeek:"[\u0997\u09A4] dddd [\u098F] LT [\u09B8\u09AE\u09AF\u09BC]",sameElse:"L"}};var V={name:"ur",dir:"rtl",weekdays:["\u0627\u062A\u0648\u0627\u0631","\u067E\u06CC\u0631","\u0645\u0646\u06AF\u0644","\u0628\u062F\u06BE","\u062C\u0645\u0639\u0631\u0627\u062A","\u062C\u0645\u0639\u06C1","\u06C1\u0641\u062A\u06C1"],weekdaysShort:["\u0627\u062A\u0648\u0627\u0631","\u067E\u06CC\u0631","\u0645\u0646\u06AF\u0644","\u0628\u062F\u06BE","\u062C\u0645\u0639\u0631\u0627\u062A","\u062C\u0645\u0639\u06C1","\u06C1\u0641\u062A\u06C1"],weekdaysMin:["\u0627\u062A","\u067E\u06CC","\u0645\u0646","\u0628\u062F","\u062C\u0645","\u062C\u0639","\u06C1\u0641"],months:["\u062C\u0646\u0648\u0631\u06CC","\u0641\u0631\u0648\u0631\u06CC","\u0645\u0627\u0631\u0686","\u0627\u067E\u0631\u06CC\u0644","\u0645\u0626\u06CC","\u062C\u0648\u0646","\u062C\u0648\u0644\u0627\u0626\u06CC","\u0627\u06AF\u0633\u062A","\u0633\u062A\u0645\u0628\u0631","\u0627\u06A9\u062A\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062F\u0633\u0645\u0628\u0631"],monthsShort:["\u062C\u0646","\u0641\u0631","\u0645\u0627\u0631","\u0627\u067E\u0631","\u0645\u0626\u06CC","\u062C\u0648\u0646","\u062C\u0648\u0644","\u0627\u06AF","\u0633\u062A","\u0627\u06A9\u062A","\u0646\u0648","\u062F\u0633"],ordinal:n=>`${n}\u0648\u0627\u06BA`,relativeTime:{future:"%s \u0645\u06CC\u06BA",past:"%s \u067E\u06C1\u0644\u06D2",s:"\u0686\u0646\u062F \u0633\u06CC\u06A9\u0646\u0688",m:"\u0627\u06CC\u06A9 \u0645\u0646\u0679",mm:"%d \u0645\u0646\u0679",h:"\u0627\u06CC\u06A9 \u06AF\u06BE\u0646\u0679\u06C1",hh:"%d \u06AF\u06BE\u0646\u0679\u06D2",d:"\u0627\u06CC\u06A9 \u062F\u0646",dd:"%d \u062F\u0646",M:"\u0627\u06CC\u06A9 \u0645\u06C1\u06CC\u0646\u06C1",MM:"%d \u0645\u06C1\u06CC\u0646\u06D2",y:"\u0627\u06CC\u06A9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},calendar:{sameDay:"[\u0622\u062C] LT [\u0628\u062C\u06D2]",nextDay:"[\u06A9\u0644] LT [\u0628\u062C\u06D2]",nextWeek:"dddd [\u06A9\u0648] LT [\u0628\u062C\u06D2]",lastDay:"[\u06AF\u0632\u0634\u062A\u06C1 \u06A9\u0644] LT [\u0628\u062C\u06D2]",lastWeek:"[\u06AF\u0632\u0634\u062A\u06C1] dddd [\u06A9\u0648] LT [\u0628\u062C\u06D2]",sameElse:"L"}};var _={name:"pt",dir:"ltr",weekdays:["Domingo","Segunda-feira","Ter\xE7a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S\xE1bado"],weekdaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"],weekdaysMin:["Do","Se","Te","Qa","Qi","Sx","S\xE1"],months:["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],ordinal:n=>`${n}\xBA`,relativeTime:{future:"em %s",past:"h\xE1 %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xEAs",MM:"%d meses",y:"um ano",yy:"%d anos"},calendar:{sameDay:"[Hoje \xE0s] LT",nextDay:"[Amanh\xE3 \xE0s] LT",nextWeek:"dddd [\xE0s] LT",lastDay:"[Ontem \xE0s] LT",lastWeek:"dddd [passado \xE0s] LT",sameElse:"L"}};var j={name:"ja",dir:"ltr",weekdays:["\u65E5\u66DC\u65E5","\u6708\u66DC\u65E5","\u706B\u66DC\u65E5","\u6C34\u66DC\u65E5","\u6728\u66DC\u65E5","\u91D1\u66DC\u65E5","\u571F\u66DC\u65E5"],weekdaysShort:["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"],weekdaysMin:["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"],months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ordinal:n=>`${n}\u65E5`,relativeTime:{future:"%s\u5F8C",past:"%s\u524D",s:"\u6570\u79D2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65E5",dd:"%d\u65E5",M:"1\u30F6\u6708",MM:"%d\u30F6\u6708",y:"1\u5E74",yy:"%d\u5E74"},calendar:{sameDay:"[\u4ECA\u65E5] LT",nextDay:"[\u660E\u65E5] LT",nextWeek:"dddd LT",lastDay:"[\u6628\u65E5] LT",lastWeek:"[\u5148\u9031] dddd LT",sameElse:"L"}};var q={name:"ko",dir:"ltr",weekdays:["\uC77C\uC694\uC77C","\uC6D4\uC694\uC77C","\uD654\uC694\uC77C","\uC218\uC694\uC77C","\uBAA9\uC694\uC77C","\uAE08\uC694\uC77C","\uD1A0\uC694\uC77C"],weekdaysShort:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],weekdaysMin:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],months:["1\uC6D4","2\uC6D4","3\uC6D4","4\uC6D4","5\uC6D4","6\uC6D4","7\uC6D4","8\uC6D4","9\uC6D4","10\uC6D4","11\uC6D4","12\uC6D4"],monthsShort:["1\uC6D4","2\uC6D4","3\uC6D4","4\uC6D4","5\uC6D4","6\uC6D4","7\uC6D4","8\uC6D4","9\uC6D4","10\uC6D4","11\uC6D4","12\uC6D4"],ordinal:n=>`${n}\uC77C`,relativeTime:{future:"%s \uD6C4",past:"%s \uC804",s:"\uBA87 \uCD08",m:"1\uBD84",mm:"%d\uBD84",h:"\uD55C \uC2DC\uAC04",hh:"%d\uC2DC\uAC04",d:"\uD558\uB8E8",dd:"%d\uC77C",M:"\uD55C \uB2EC",MM:"%d\uB2EC",y:"\uC77C \uB144",yy:"%d\uB144"},calendar:{sameDay:"[\uC624\uB298] LT",nextDay:"[\uB0B4\uC77C] LT",nextWeek:"dddd LT",lastDay:"[\uC5B4\uC81C] LT",lastWeek:"[\uC9C0\uB09C] dddd LT",sameElse:"L"}};function L(n,e,t,r){let a=Math.abs(Math.round(n)),s=a%10,i=a%100;return i>=11&&i<=19?`${n} ${r}`:s===1?`${n} ${e}`:s>=2&&s<=4?`${n} ${t}`:`${n} ${r}`}var G={name:"ru",dir:"ltr",weekdays:["\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435","\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041F\u044F\u0442\u043D\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043E\u0442\u0430"],weekdaysShort:["\u0412\u0441","\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431"],weekdaysMin:["\u0432\u0441","\u043F\u043D","\u0432\u0442","\u0441\u0440","\u0447\u0442","\u043F\u0442","\u0441\u0431"],months:["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],monthsShort:["\u042F\u043D\u0432","\u0424\u0435\u0432","\u041C\u0430\u0440","\u0410\u043F\u0440","\u041C\u0430\u0439","\u0418\u044E\u043D","\u0418\u044E\u043B","\u0410\u0432\u0433","\u0421\u0435\u043D","\u041E\u043A\u0442","\u041D\u043E\u044F","\u0414\u0435\u043A"],ordinal:n=>`${n}-\u0439`,relativeTime:{future:"\u0447\u0435\u0440\u0435\u0437 %s",past:"%s \u043D\u0430\u0437\u0430\u0434",s:"\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0441\u0435\u043A\u0443\u043D\u0434",m:"\u043C\u0438\u043D\u0443\u0442\u0443",mm:n=>L(n,"\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u044B","\u043C\u0438\u043D\u0443\u0442"),h:"\u0447\u0430\u0441",hh:n=>L(n,"\u0447\u0430\u0441","\u0447\u0430\u0441\u0430","\u0447\u0430\u0441\u043E\u0432"),d:"\u0434\u0435\u043D\u044C",dd:n=>L(n,"\u0434\u0435\u043D\u044C","\u0434\u043D\u044F","\u0434\u043D\u0435\u0439"),M:"\u043C\u0435\u0441\u044F\u0446",MM:n=>L(n,"\u043C\u0435\u0441\u044F\u0446","\u043C\u0435\u0441\u044F\u0446\u0430","\u043C\u0435\u0441\u044F\u0446\u0435\u0432"),y:"\u0433\u043E\u0434",yy:n=>L(n,"\u0433\u043E\u0434","\u0433\u043E\u0434\u0430","\u043B\u0435\u0442")},calendar:{sameDay:"[\u0421\u0435\u0433\u043E\u0434\u043D\u044F \u0432] LT",nextDay:"[\u0417\u0430\u0432\u0442\u0440\u0430 \u0432] LT",nextWeek:"dddd [\u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432] LT",lastWeek:"[\u0412 \u043F\u0440\u043E\u0448\u043B\u044B\u0439] dddd [\u0432] LT",sameElse:"L"}};var Y={en:H,es:J,fr:R,de:z,ar:Q,zh:B,hi:P,bn:Z,ur:V,pt:_,ja:j,ko:q,ru:G};function w(n){return n in Y||console.warn(`[DateKit] Locale "${n}" is not registered. Falling back to "en". Register it with registerLocale() or import it from "datekit/locales/${n}".`),Y[n]||Y.en}function oe(n){Y[n.name]=n}function K(n,e,t="en"){let r=w(t),a=n.getUTCFullYear(),s=n.getUTCMonth(),i=n.getUTCDate(),o=n.getUTCHours(),l=n.getUTCMinutes(),m=n.getUTCSeconds(),u=n.getUTCMilliseconds(),c=n.getUTCDay(),d=new Date(Date.UTC(a,0,1)),D=Math.floor((n.getTime()-d.getTime())/864e5)+1,g=Math.floor(s/3)+1,f=ie(n),k=new Map,A=new Map,I={YYYY:a.toString(),YY:a.toString().slice(-2),Qo:r.ordinal(g),Q:g.toString(),MMMM:r.months[s],MMM:r.monthsShort[s],Mo:r.ordinal(s+1),MM:(s+1).toString().padStart(2,"0"),M:(s+1).toString(),Wo:r.ordinal(f),WW:f.toString().padStart(2,"0"),W:f.toString(),wo:r.ordinal(f),ww:f.toString().padStart(2,"0"),w:f.toString(),DDDo:r.ordinal(D),DDDD:D.toString().padStart(3,"0"),DDD:D.toString(),Do:r.ordinal(i),DD:i.toString().padStart(2,"0"),D:i.toString(),dddd:r.weekdays[c],ddd:r.weekdaysShort[c],do:r.ordinal(c),dd:r.weekdaysMin[c],d:c.toString(),HH:o.toString().padStart(2,"0"),H:o.toString(),hh:(o%12||12).toString().padStart(2,"0"),h:(o%12||12).toString(),mm:l.toString().padStart(2,"0"),m:l.toString(),ss:m.toString().padStart(2,"0"),s:m.toString(),SSS:u.toString().padStart(3,"0"),SS:u.toString().padStart(2,"0").slice(0,2),S:Math.floor(u/100).toString(),A:o>=12?"PM":"AM",a:o>=12?"pm":"am",Z:X(n.getTimezoneOffset()),ZZ:X(n.getTimezoneOffset()).replace(":",""),X:Math.floor(n.getTime()/1e3).toString(),x:n.getTime().toString()},T=e,U=[];return T=T.replace(/\[([^\]]*?)\]/g,(p,M)=>{let v=`${U.length}`;return U.push(M),v}),Object.keys(I).sort((p,M)=>M.length-p.length).forEach((p,M)=>{let v=`\0${M}\0`,ae=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),se=new RegExp(ae,"g");T=T.replace(se,v),A.set(v,I[p])}),A.forEach((p,M)=>{T=T.replace(new RegExp(M,"g"),p)}),U.forEach((p,M)=>{T=T.split(`${M}`).join(p)}),T}function ie(n){let e=new Date(n.getTime());e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}function X(n){let e=n<=0?"+":"-",t=Math.abs(n),r=Math.floor(t/60),a=t%60;return`${e}${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}var de=[{token:"YYYY",regex:"(\\d{4})",key:"year"},{token:"YY",regex:"(\\d{2})",key:"year2"},{token:"MM",regex:"(\\d{1,2})",key:"month"},{token:"M",regex:"(\\d{1,2})",key:"month"},{token:"DD",regex:"(\\d{1,2})",key:"day"},{token:"D",regex:"(\\d{1,2})",key:"day"},{token:"HH",regex:"(\\d{1,2})",key:"hour"},{token:"H",regex:"(\\d{1,2})",key:"hour"},{token:"hh",regex:"(\\d{1,2})",key:"hour12"},{token:"h",regex:"(\\d{1,2})",key:"hour12"},{token:"mm",regex:"(\\d{1,2})",key:"minute"},{token:"m",regex:"(\\d{1,2})",key:"minute"},{token:"ss",regex:"(\\d{1,2})",key:"second"},{token:"s",regex:"(\\d{1,2})",key:"second"},{token:"SSS",regex:"(\\d{1,3})",key:"ms"},{token:"A",regex:"(AM|PM)",key:"ampm"},{token:"a",regex:"(am|pm)",key:"ampm"}],me=[...de].sort((n,e)=>e.token.length-n.token.length);function ee(n,e){let t=[],r=e.replace(/\[([^\]]*?)\]/g,(d,D)=>{let g=`${t.length}`;return t.push(D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),g}),a=r;a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");let s=[],i=[],o=r;for(;o.length>0;){let d=o.match(/^\x02(\d+)\x02/);if(d){i.push(t[parseInt(d[1])]),o=o.slice(d[0].length);continue}let D=!1;for(let{token:g,regex:f,key:k}of me)if(o.startsWith(g)){i.push(f),s.push(k),o=o.slice(g.length),D=!0;break}if(!D){let g=o[0];i.push(g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=o.slice(1)}}let l=new RegExp(`^${i.join("")}$`),m=n.trim().match(l);if(!m)throw new Error(`DateKit.parse: "${n}" does not match format "${e}".`);let u={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0},c="";if(s.forEach((d,D)=>{let g=m[D+1];if(d==="ampm")c=g.toUpperCase();else if(d==="year2"){let f=parseInt(g,10);u.year=f>=70?1900+f:2e3+f}else u[d]=parseInt(g,10)}),"hour12"in u||c){let d=u.hour12??u.hour;c==="PM"&&d<12&&(d+=12),c==="AM"&&d===12&&(d=0),u.hour=d,delete u.hour12}return new Date(Date.UTC(u.year,u.month-1,u.day,u.hour??0,u.minute??0,u.second??0,u.ms??0))}var ue=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function h(n,e){if(n instanceof Date)return new Date(n);if(typeof n=="number")return new Date(n);if(typeof n=="string"){if(e&&!ue.test(n.trim()))throw new Error(`Strict parsing failed: "${n}" is not an unambiguous ISO 8601 date string. Use a format like "YYYY-MM-DD" or "YYYY-MM-DDTHH:mm:ssZ", or disable strict mode.`);return new Date(n)}throw new Error("Invalid date input")}function O(n){return n instanceof Date&&!isNaN(n.getTime())}function x(n,e){return typeof n=="function"?n(e):n.replace("%d",String(e))}function b(n,e="en",t=!1){let r=w(e),a=n<0,i=Math.abs(n)/1e3,o=i/60,l=o/60,m=l/24,u=m/30.44,c=m/365.25,d;return i<45?d=r.relativeTime.s:i<90?d=r.relativeTime.m:o<45?d=x(r.relativeTime.mm,Math.round(o)):o<90?d=r.relativeTime.h:l<22?d=x(r.relativeTime.hh,Math.round(l)):l<36?d=r.relativeTime.d:m<25?d=x(r.relativeTime.dd,Math.round(m)):m<45?d=r.relativeTime.M:m<345?d=x(r.relativeTime.MM,Math.round(u)):c<1.5?d=r.relativeTime.y:d=x(r.relativeTime.yy,Math.round(c)),t?d:(a?r.relativeTime.future:r.relativeTime.past).replace("%s",d)}function te(n,e=new Date,t="en"){let r=w(t),a=new S(n),s=new S(e),i=a.startOf("day").diff(s.startOf("day").toDate(),"day"),o;return i===0?o=r.calendar.sameDay:i===1?o=r.calendar.nextDay:i===-1?o=r.calendar.lastDay:i>1&&i<=7?o=r.calendar.nextWeek:i<-1&&i>=-7?o=r.calendar.lastWeek:o=r.calendar.sameElse,o=o.replace(/\[([^\]]*?)\]/g,"$1").replace(/\bLT\b/g,a.format("HH:mm")).replace(/\bL\b/g,a.format("MM/DD/YYYY")).replace(/\bdddd\b/g,r.weekdays[n.getUTCDay()]),o}var re=[1,2,3,4,5];function $(n,e=[]){let t=n.getUTCDay();if(!re.includes(t))return!1;let r=n.toISOString().split("T")[0];return!e.some(a=>a.toISOString().split("T")[0]===r)}function F(n,e,t=[]){let r=new Date(n),a=Math.abs(e),s=e>0?1:-1;for(;a>0;)r.setUTCDate(r.getUTCDate()+s),$(r,t)&&a--;return r}function ne(n,e,t=[]){let r=0,a=new Date(n);a.setUTCDate(a.getUTCDate()+1);let s=new Date(e);for(;a<=s;)$(a,t)&&r++,a.setUTCDate(a.getUTCDate()+1);return r}function C(n,e){let r=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(n),a=o=>parseInt(r.find(l=>l.type===o)?.value??"0"),s=a("hour");return s===24&&(s=0),Date.UTC(a("year"),a("month")-1,a("day"),s,a("minute"),a("second"))-(n.getTime()-n.getUTCMilliseconds())}var E=315576e5,W=26298e5,y=class n{constructor(e,t="milliseconds"){typeof e=="number"?this._milliseconds=this.convertToMilliseconds(e,t):this._milliseconds=this.objectToMilliseconds(e)}convertToMilliseconds(e,t){return e*({milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5}[t]||1)}objectToMilliseconds(e){let t=0;return e.years&&(t+=e.years*E),e.months&&(t+=e.months*W),e.weeks&&(t+=e.weeks*6048e5),e.days&&(t+=e.days*864e5),e.hours&&(t+=e.hours*36e5),e.minutes&&(t+=e.minutes*6e4),e.seconds&&(t+=e.seconds*1e3),e.milliseconds&&(t+=e.milliseconds),t}asMilliseconds(){return this._milliseconds}asSeconds(){return this._milliseconds/1e3}asMinutes(){return this._milliseconds/6e4}asHours(){return this._milliseconds/36e5}asDays(){return this._milliseconds/864e5}asWeeks(){return this._milliseconds/6048e5}asMonths(){return this._milliseconds/W}asYears(){return this._milliseconds/E}humanize(e="en",t=!0){return b(this._milliseconds,e,t)}toObject(){let e=Math.abs(this._milliseconds),t=Math.floor(e/E);e-=t*E;let r=Math.floor(e/W);e-=r*W;let a=Math.floor(e/864e5);e-=a*864e5;let s=Math.floor(e/36e5);e-=s*36e5;let i=Math.floor(e/6e4);e-=i*6e4;let o=Math.floor(e/1e3);e-=o*1e3;let l=Math.floor(e);return{years:t,months:r,days:a,hours:s,minutes:i,seconds:o,milliseconds:l}}add(e){return new n(this._milliseconds+e.asMilliseconds())}subtract(e){return new n(this._milliseconds-e.asMilliseconds())}static between(e,t){return new n(Math.abs(t.getTime()-e.getTime()))}};var S=class n{constructor(e,t){if(this.config={locale:"en",weekStartsOn:0,strictParsing:!1,...t},this.date=e?h(e,this.config.strictParsing):new Date,!O(this.date))throw new Error("Invalid date provided")}toDate(){return new Date(this.date)}toISOString(){return this.date.toISOString()}toUnix(){return Math.floor(this.date.getTime()/1e3)}valueOf(){return this.date.getTime()}toArray(){return[this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate(),this.date.getUTCHours(),this.date.getUTCMinutes(),this.date.getUTCSeconds(),this.date.getUTCMilliseconds()]}toObject(){return{year:this.date.getUTCFullYear(),month:this.date.getUTCMonth(),date:this.date.getUTCDate(),hour:this.date.getUTCHours(),minute:this.date.getUTCMinutes(),second:this.date.getUTCSeconds(),millisecond:this.date.getUTCMilliseconds()}}toJSON(){return this.toISOString()}toString(){return this.date.toString()}format(e){return K(this.date,e,this.config.locale)}static formatFromTimezoneString(e,t){let r,a;if(e instanceof Date?(a=e,r=e.toString()):typeof e=="number"?(a=new Date(e),r=a.toString()):(r=e,a=new Date(e)),isNaN(a.getTime()))throw new Error("Invalid date provided");let s=r.match(/GMT([+-]\d{2}):?(\d{2})|UTC([+-]\d{2}):?(\d{2})/i),i=0;if(s){let I=(s[1]||s[3])[0],T=parseInt((s[1]||s[3]).substring(1)),U=parseInt(s[2]||s[4]||"0");i=(T*60+U)*(I==="+"?1:-1)}else i=-a.getTimezoneOffset();let l=a.getTime()+i*60*1e3,m=new Date(l),u=m.getUTCFullYear(),c=m.getUTCMonth(),d=m.getUTCDate(),D=m.getUTCHours(),g=m.getUTCMinutes(),f=m.getUTCSeconds(),k=m.getUTCMilliseconds();return new n(Date.UTC(u,c,d,D,g,f,k)).format(t)}static formatZonedDate(e,t="DD-MM-YYYY",r="en"){let a,s;if(e instanceof Date?(s=e,a=e.toString()):typeof e=="number"?(s=new Date(e),a=s.toString()):(a=e,s=new Date(e)),isNaN(s.getTime()))throw new Error("Invalid date input for formatZonedDate");let i=a.match(/GMT([+-])(\d{2}):?(\d{2})/i),o=s;if(i){let l=i[1]==="-"?-1:1,m=parseInt(i[2],10),u=parseInt(i[3],10),c=l*(m*60+u),d=s.getTime()+c*6e4;o=new Date(d)}return K(o,t,r)}formatZonedDate(e,t="DD-MM-YYYY"){let r=this.config?.locale??"en";return n.formatZonedDate(e,t,r)}static convertTimezone(e,t,r,a){let s=h(e);if(!O(s))throw new Error("Invalid date provided");let i,o,l,m,u,c;if(typeof e=="string"&&!e.includes("Z")&&!e.includes("+")&&!e.includes("GMT")){let d=e.match(/(\d{4})-(\d{2})-(\d{2})[T\s](\d{2}):(\d{2}):(\d{2})/);d?(i=parseInt(d[1]),o=parseInt(d[2]),l=parseInt(d[3]),m=parseInt(d[4]),u=parseInt(d[5]),c=parseInt(d[6])):(i=s.getUTCFullYear(),o=s.getUTCMonth()+1,l=s.getUTCDate(),m=s.getUTCHours(),u=s.getUTCMinutes(),c=s.getUTCSeconds());let D=`${i}-${o.toString().padStart(2,"0")}-${l.toString().padStart(2,"0")}T${m.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,g=new Date(Date.UTC(i,o-1,l,m,u,c)),f=g.getTime()-C(g,t);f=g.getTime()-C(new Date(f),t);let k=new Date(f);return n.formatInTimezone(k,r,a)}else return n.formatInTimezone(s,r,a)}static formatInTimezone(e,t,r){let a=h(e);if(!O(a))throw new Error("Invalid date provided");let i=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(a),o={};return i.forEach(m=>{m.type!=="literal"&&(o[m.type]=m.value)}),new n(Date.UTC(parseInt(o.year),parseInt(o.month)-1,parseInt(o.day),parseInt(o.hour),parseInt(o.minute),parseInt(o.second))).format(r)}static fromTimezone(e,t,r,a=0,s=0,i=0,o="UTC"){let l=`${e}-${t.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`,m=new Intl.DateTimeFormat("en-US",{timeZone:o,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),u=new Date(Date.UTC(e,t-1,r,a,s,i)),c=u.getTime()-C(u,o);return c=u.getTime()-C(new Date(c),o),new n(c)}static getTimezoneOffset(e,t=new Date){return C(t,e)/6e4}year(){return this.date.getUTCFullYear()}month(){return this.date.getUTCMonth()}getDate(){return this.date.getUTCDate()}day(){return this.date.getUTCDay()}hour(){return this.date.getUTCHours()}minute(){return this.date.getUTCMinutes()}second(){return this.date.getUTCSeconds()}millisecond(){return this.date.getUTCMilliseconds()}quarter(){return Math.floor(this.date.getUTCMonth()/3)+1}week(){return this.isoWeek()}isoWeek(){let e=new Date(this.date.getTime());e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}weekday(){return(this.date.getUTCDay()+7-this.config.weekStartsOn)%7}isoWeekday(){return this.date.getUTCDay()||7}dayOfYear(){let e=new Date(Date.UTC(this.date.getUTCFullYear(),0,1));return Math.floor((this.date.getTime()-e.getTime())/864e5)+1}weekYear(){let e=new Date(this.date.getTime());return e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7)),e.getUTCFullYear()}set(e){let t=new Date(this.date);return e.year!==void 0&&t.setUTCFullYear(e.year),e.month!==void 0&&t.setUTCMonth(e.month),e.date!==void 0&&t.setUTCDate(e.date),e.hour!==void 0&&t.setUTCHours(e.hour),e.minute!==void 0&&t.setUTCMinutes(e.minute),e.second!==void 0&&t.setUTCSeconds(e.second),e.millisecond!==void 0&&t.setUTCMilliseconds(e.millisecond),new n(t,this.config)}setYear(e){return this.set({year:e})}setMonth(e){return this.set({month:e})}setDate(e){return this.set({date:e})}setHour(e){return this.set({hour:e})}setMinute(e){return this.set({minute:e})}setSecond(e){return this.set({second:e})}setMillisecond(e){return this.set({millisecond:e})}setQuarter(e){let t=(e-1)*3;return this.set({month:t})}add(e,t){let r=new Date(this.date);switch(t){case"millisecond":r.setUTCMilliseconds(r.getUTCMilliseconds()+e);break;case"second":r.setUTCSeconds(r.getUTCSeconds()+e);break;case"minute":r.setUTCMinutes(r.getUTCMinutes()+e);break;case"hour":r.setUTCHours(r.getUTCHours()+e);break;case"day":r.setUTCDate(r.getUTCDate()+e);break;case"week":r.setUTCDate(r.getUTCDate()+e*7);break;case"month":r.setUTCMonth(r.getUTCMonth()+e);break;case"quarter":r.setUTCMonth(r.getUTCMonth()+e*3);break;case"year":r.setUTCFullYear(r.getUTCFullYear()+e);break}return new n(r,this.config)}subtract(e,t){return this.add(-e,t)}startOf(e){let t=new Date(this.date);switch(e){case"year":t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);break;case"quarter":{let r=this.quarter();t.setUTCMonth((r-1)*3,1),t.setUTCHours(0,0,0,0);break}case"month":t.setUTCDate(1),t.setUTCHours(0,0,0,0);break;case"week":{let r=t.getUTCDay(),a=(r<this.config.weekStartsOn?7:0)+r-this.config.weekStartsOn;t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0);break}case"day":t.setUTCHours(0,0,0,0);break;case"hour":t.setUTCMinutes(0,0,0);break;case"minute":t.setUTCSeconds(0,0);break;case"second":t.setUTCMilliseconds(0);break}return new n(t,this.config)}endOf(e){return this.startOf(e).add(1,e).subtract(1,"millisecond")}isBefore(e,t){return t?this.startOf(t).valueOf()<new n(e).startOf(t).valueOf():this.date.getTime()<h(e).getTime()}isAfter(e,t){return t?this.startOf(t).valueOf()>new n(e).startOf(t).valueOf():this.date.getTime()>h(e).getTime()}isSame(e,t){if(!t)return this.date.getTime()===h(e).getTime();let r=this.startOf(t),a=new n(e,this.config).startOf(t);return r.date.getTime()===a.date.getTime()}isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)}isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)}isBetween(e,t,r,a="()"){let s=r?new n(e).startOf(r).valueOf():h(e).getTime(),i=r?new n(t).startOf(r).valueOf():h(t).getTime(),o=r?this.startOf(r).valueOf():this.date.getTime(),l=a[0]==="["?o>=s:o>s,m=a[1]==="]"?o<=i:o<i;return l&&m}isToday(){return this.isSame(new Date,"day")}isTomorrow(){let e=new n().add(1,"day");return this.isSame(e.toDate(),"day")}isYesterday(){let e=new n().subtract(1,"day");return this.isSame(e.toDate(),"day")}isThisWeek(){return this.isSame(new Date,"week")}isThisMonth(){return this.isSame(new Date,"month")}isThisQuarter(){return this.isSame(new Date,"quarter")}isThisYear(){return this.isSame(new Date,"year")}isWeekend(){let e=this.date.getUTCDay();return e===0||e===6}isWeekday(){return!this.isWeekend()}isLeapYear(){let e=this.date.getUTCFullYear();return e%4===0&&e%100!==0||e%400===0}isDST(){let e=new Date(Date.UTC(this.year(),0,1)),t=new Date(Date.UTC(this.year(),6,1)),r=Math.max(e.getTimezoneOffset(),t.getTimezoneOffset());return this.date.getTimezoneOffset()<r}diff(e,t="millisecond",r=!1){let a=h(e),s=this.date.getTime()-a.getTime(),i=1;switch(t){case"millisecond":return s;case"second":i=1e3;break;case"minute":i=1e3*60;break;case"hour":i=1e3*60*60;break;case"day":i=1e3*60*60*24;break;case"week":i=1e3*60*60*24*7;break;case"month":return r?s/(1e3*60*60*24*30.436875):this.diffMonth(a);case"quarter":return r?s/(1e3*60*60*24*91.3125):Math.floor(this.diffMonth(a)/3);case"year":return r?s/(1e3*60*60*24*365.25):this.diffYear(a)}let o=s/i;return r?o:Math.floor(o)}diffMonth(e){let t=this.date.getUTCFullYear()-e.getUTCFullYear(),r=this.date.getUTCMonth()-e.getUTCMonth();return t*12+r}diffYear(e){return this.date.getUTCFullYear()-e.getUTCFullYear()}fromNow(e=!1){let t=Date.now()-this.date.getTime();return b(t,this.config.locale,e)}toNow(e=!1){let t=this.date.getTime()-Date.now();return b(t,this.config.locale,e)}from(e,t=!1){let r=h(e).getTime()-this.date.getTime();return b(r,this.config.locale,t)}to(e,t=!1){let r=this.date.getTime()-h(e).getTime();return b(r,this.config.locale,t)}calendar(e){let t=e?h(e):new Date;return te(this.date,t,this.config.locale)}duration(e){return e?y.between(this.date,h(e)):new y(this.date.getTime())}daysInMonth(){return new Date(Date.UTC(this.date.getUTCFullYear(),this.date.getUTCMonth()+1,0)).getUTCDate()}weeksInYear(){let e=new Date(Date.UTC(this.year(),11,28));return new n(e).isoWeek()}age(e){let t=e?h(e):new Date,r=this.date;if(r>t)throw new RangeError("age(): this date is in the future relative to the reference date. Pass a birthdate, not a future date.");let a=t.getUTCFullYear()-r.getUTCFullYear(),s=r.getUTCMonth(),i=r.getUTCDate(),o=t.getUTCMonth(),l=t.getUTCDate();return(o<s||o===s&&l<i)&&a--,a}clone(){return new n(this.date,this.config)}isBusinessDay(e=[]){return $(this.date,e)}addBusinessDays(e,t=[]){return new n(F(this.date,e,t),this.config)}subtractBusinessDays(e,t=[]){return new n(F(this.date,-e,t),this.config)}businessDaysUntil(e,t=[]){return ne(this.date,h(e),t)}locale(e){return e===void 0?this.config.locale:new n(this.date,{...this.config,locale:e})}static eachDayOfInterval(e){let t=new n(e.start),r=new n(e.end);if(t.isAfter(r.toDate(),"day"))throw new RangeError(`eachDayOfInterval: start date must not be after end date. Got start=${t.toISOString()}, end=${r.toISOString()}.`);let a=[],s=t.clone();for(;s.isSameOrBefore(r.toDate(),"day");)a.push(s.clone()),s=s.add(1,"day");return a}static eachWeekOfInterval(e){let t=new n(e.start).startOf("week"),r=new n(e.end);if(t.isAfter(r.toDate(),"week"))throw new RangeError(`eachWeekOfInterval: start date must not be after end date. Got start=${new n(e.start).toISOString()}, end=${r.toISOString()}.`);let a=[],s=t.clone();for(;s.isSameOrBefore(r.toDate(),"week");)a.push(s.clone()),s=s.add(1,"week");return a}static eachMonthOfInterval(e){let t=new n(e.start).startOf("month"),r=new n(e.end);if(t.isAfter(r.toDate(),"month"))throw new RangeError(`eachMonthOfInterval: start date must not be after end date. Got start=${new n(e.start).toISOString()}, end=${r.toISOString()}.`);let a=[],s=t.clone();for(;s.isSameOrBefore(r.toDate(),"month");)a.push(s.clone()),s=s.add(1,"month");return a}static now(){return new n}static utc(e){return e?new n(e):new n(new Date)}static unix(e){return new n(e*1e3)}static isValid(e){try{return O(h(e))}catch{return!1}}static max(...e){let t=e.map(r=>h(r).getTime());return new n(Math.max(...t))}static min(...e){let t=e.map(r=>h(r).getTime());return new n(Math.min(...t))}static isDuration(e){return e instanceof y}static duration(e,t){return typeof e=="number"&&t?new y(e,t):new y(e)}static parse(e,t,r){let a=ee(e,t);return new n(a,r)}};var N=class n{constructor(e,t){if(this.start=new S(e),this.end=new S(t),this.start.valueOf()>this.end.valueOf())throw new RangeError(`DateRange: start must not be after end. start=${this.start.toISOString()}, end=${this.end.toISOString()}`)}contains(e){let t=h(e).getTime();return t>=this.start.valueOf()&&t<=this.end.valueOf()}overlaps(e){return this.start.valueOf()<=e.end.valueOf()&&this.end.valueOf()>=e.start.valueOf()}intersection(e){let t=Math.max(this.start.valueOf(),e.start.valueOf()),r=Math.min(this.end.valueOf(),e.end.valueOf());return t>r?null:new n(t,r)}union(e){let t=Math.min(this.start.valueOf(),e.start.valueOf()),r=Math.max(this.end.valueOf(),e.end.valueOf());return new n(t,r)}duration(){return y.between(this.start.toDate(),this.end.toDate())}toArray(e="day"){let t=[],r=this.start.startOf(e);for(;r.valueOf()<=this.end.valueOf();)t.push(r.clone()),r=r.add(1,e);return t}days(){return Math.floor(this.duration().asDays())}toString(){return`[${this.start.toISOString()} / ${this.end.toISOString()}]`}toJSON(){return{start:this.start.toISOString(),end:this.end.toISOString()}}};export{S as DateKit,N as DateRange,y as Duration,Q as ar,Z as bn,z as de,H as en,J as es,R as fr,w as getLocale,P as hi,j as ja,q as ko,_ as pt,oe as registerLocale,G as ru,V as ur,B as zh};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subrotosaha/datekit",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A modern, lightweight TypeScript library for date manipulation with timezone support, business days, and chainable API.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",