import{m as momentTimezone}from"./index-e6685442.js";var CalendarUtils={timeZone:"Europe/Istanbul",locale:"tr",timeFormat:"24-hour",setLocale:function(e){momentTimezone.locale(e);CalendarUtils.locale=e},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 n=momentTimezone.tz.zone(CalendarUtils.timeZone).offset(new Date);var o=(t-n)/60;e.setHours(e.getHours()-o);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,n){var o=new Date(e.getTime());o.setHours(t.getHours(),t.getMinutes(),0);var r=new Date(e.getTime());r.setHours(n.getHours(),n.getMinutes(),0);o=CalendarUtils.fixHourDifference(o);r=CalendarUtils.fixHourDifference(r);return{startDate:o.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 n=new Date(new Date(CalendarUtils.getMonday()).getTime()+t);n.setHours(0,0,0,0);var o=new Date(n.getTime());o.setDate(n.getDate()+6);o.setHours(23,59,59,99);return{relativeWeekNumber:e,firstDayOfWeek:n,lastDayOfWeek:o}}};export{CalendarUtils as C};