import{m as momentTimezone}from"./index-3958847a.js";var CalendarUtils={timeZone:"Europe/Istanbul",locale:"tr",timeFormat:"24-hour",dayNamesOrdered:[],setLocale:function(e,t,a){if(a===void 0){a="monday"}momentTimezone.locale(e);CalendarUtils.locale=e;if(t){setMomentI18n(e,t);var n=[t.sunday3,t.monday3,t.tuesday3,t.wednesday3,t.thursday3,t.friday3,t.saturday3];var r=[];for(var o=0;o<7;o++){r.push(n[(o+CalendarUtils.getWeekStartIndex(a))%7])}CalendarUtils.dayNamesOrdered=r}},getWeekStartIndex:function(e){switch(e){case"monday":return 1;case"saturday":return 6;case"sunday":default:return 0}},setTimeZone:function(e){if(e==="Europe/Istanbul"){CalendarUtils.timeZone="Europe/Moscow"}else{CalendarUtils.timeZone=e}},setTimeFormat:function(e){CalendarUtils.timeFormat=e},fixHourDifference:function(e){var t=(new Date).getTimezoneOffset();var a=momentTimezone.tz.zone(CalendarUtils.timeZone).offset(new Date);var n=(t-a)/60;e.setHours(e.getHours()-n);return e},format:function(e,t){if(t==="HH:mm"&&CalendarUtils.timeFormat==="12-hour"){return momentTimezone(e).tz(CalendarUtils.timeZone).format("hh:mm A")}return momentTimezone(e).tz(CalendarUtils.timeZone).format(t)},getStartAndEndDateFromInputs:function(e,t,a){var n=new Date(e.getTime());n.setHours(t.getHours(),t.getMinutes(),0);var r=new Date(e.getTime());r.setHours(a.getHours(),a.getMinutes(),0);n=CalendarUtils.fixHourDifference(n);r=CalendarUtils.fixHourDifference(r);return{startDate:n.getTime()/1e3,endDate:r.getTime()/1e3}},elapsedTime:function(e){return momentTimezone(e).tz(CalendarUtils.timeZone).fromNow()},elapsedTimeBetweenDates:function(e,t){return momentTimezone(e).from(momentTimezone(t))},getMonday:function(){return momentTimezone().startOf("isoWeek").toDate()},getStartEndOfWeek:function(e){if(e===void 0){e=0}var t=e*(7*24*60*60*1e3);var a=new Date(new Date(CalendarUtils.getMonday()).getTime()+t);a.setHours(0,0,0,0);var n=new Date(a.getTime());n.setDate(a.getDate()+6);n.setHours(23,59,59,99);return{relativeWeekNumber:e,firstDayOfWeek:a,lastDayOfWeek:n}}};function setMomentI18n(e,t){momentTimezone.locale(e,{months:[t.january,t.february,t.march,t.april,t.may,t.june,t.july,t.august,t.september,t.october,t.november,t.december],monthsShort:[t.january3,t.february3,t.march3,t.april3,t.may3,t.june3,t.july3,t.august3,t.september3,t.october3,t.november3,t.december3],monthsParseExact:true,weekdays:[t.sunday,t.monday,t.tuesday,t.wednesday,t.thursday,t.friday,t.saturday],weekdaysShort:[t.sunday3,t.monday3,t.tuesday3,t.wednesday3,t.thursday3,t.friday3,t.saturday3],weekdaysMin:[t.sunday2,t.monday2,t.tuesday2,t.wednesday2,t.thursday2,t.friday2,t.saturday2]})}export{CalendarUtils as C};