var n={startOfDayLocal:t=>new Date(t.getFullYear(),t.getMonth(),t.getDate()),isSameDay:(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),clampDateToMonth:(t,e)=>{let r=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return t<r?r:t>a?a:t},toLocalISODate:t=>{let e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${e}-${r}-${a}`},parseLocalISO:t=>{if(!t)return null;let e=t.trim();if(!e)return null;let a=e.replace(/[./]/g,"-").match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!a)return null;let l=Number(a[1]),s=Number(a[2])-1,c=Number(a[3]),o=new Date(l,s,c);return Number.isNaN(o.getTime())?null:o},compareDates:(t,e)=>{let r=n.startOfDayLocal(t).getTime(),a=n.startOfDayLocal(e).getTime();return r-a},isBetweenInclusive:(t,e,r)=>{let a=n.compareDates(e,r)<=0?e:r,l=n.compareDates(e,r)<=0?r:e;return n.compareDates(t,a)>=0&&n.compareDates(t,l)<=0}};export{n as a};
