"use strict";var D=Object.defineProperty;var l=(o,e,t)=>e in o?D(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var n=(o,e,t)=>(l(o,typeof e!="symbol"?e+"":e,t),t);const m=require("./index.cjs78.js");require("./index.cjs79.js");const u="en",d=31,a=class a{constructor(e=u,t=a.Calendars.gregorian){n(this,"locale");n(this,"name");this.locale=e,this.name=t}addDate(e,t){const i=this.moment(e);return this.isHijri()?i.add(t,"iDate"):i.add(t,"date")}addMonth(e,t){const i=this.moment(e);return this.isHijri()?i.add(t,"iMonth"):i.add(t,"month")}addYear(e,t){const i=this.moment(e);return this.isHijri()?i.add(t,"iYear"):i.add(t,"year")}convertToDate({year:e,month:t,date:i}){let r=this.moment().hours(0).minutes(0).seconds(0);return this.isHijri()?r=r.iYear(e||this.getDefaultYear()).iMonth(t||this.getDefaultMonth()).iDate(i||this.getDefaultDate()):r=r.year(e||this.getDefaultYear()).month(t||this.getDefaultMonth()).date(i||this.getDefaultDate()),r}daysInMonth(e,t){const i=e||this.getDefaultYear(),r=t||this.getDefaultMonth(),h=this.convertToDate({year:i,month:r,date:this.getDefaultDate()});return(this.isHijri()?h.iDaysInMonth():h.daysInMonth())||d}format(e,t=a.DateFormats.gregorian){return this.moment(e).format(a.DateFormats[this.name][t])}getDefaultDate(){return a.Defaults[this.name].date}getDefaultMonth(){return a.Defaults[this.name].month}getDefaultYear(){return a.Defaults[this.name].year}isHijri(){return this.name===a.Calendars.hijri}listMonths(){const e=this.moment().localeData();return this.isHijri()?e._iMonths:e.months()}moment(e=null){const t=e?m(e):m();return t.locale(this.locale),t}parseDate(e){const t=this.moment(e);return{year:this.isHijri()?t.iYear():t.year(),month:this.isHijri()?t.iMonth():t.month(),date:this.isHijri()?t.iDate():t.date()}}};n(a,"Calendars"),n(a,"DateFormats"),n(a,"Defaults");let s=a;s.Calendars={gregorian:"gregorian",hijri:"hijri"};s.DateFormats={[s.Calendars.gregorian]:{0:"YYYY",1:"MMMM YYYY",2:"L"},[s.Calendars.hijri]:{0:"iYYYY",1:"iMMMM iYYYY",2:"iM/iD/iYYYY"}};s.Defaults={[s.Calendars.gregorian]:{year:0,month:0,date:1},[s.Calendars.hijri]:{year:1410,month:0,date:1}};module.exports=s;
//# sourceMappingURL=index.cjs22.js.map
