import*as i from"chrono-node";var l=t=>{let e=t?new Date(t):new Date;return e.toString()==="Invalid Date"?"":new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().split(":").slice(0,2).join(":")},g=t=>t instanceof Date?t:i.parseDate(t),m=(t,e)=>t.toString()==="Invalid Date"?"":new Date(t).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric",...e}),f=(t,e)=>t.toString()==="Invalid Date"?"":new Date(t).toLocaleTimeString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",hour12:!0,...e}),h=(t,e)=>{let a=Math.abs(e.getTime()-t.getTime());return Math.ceil(a/(1e3*60*60*24))},y=t=>{let e=new Date,a=e.getDate(),n=e.getMonth(),r=e.getFullYear();if(a>=t)return{firstDay:new Date(r,n,t),lastDay:new Date(r,n+1,t-1)};{let o=n===0?r-1:r,s=n===0?11:n-1;return{firstDay:new Date(o,s,t),lastDay:new Date(r,n,t-1)}}},c=()=>{let t=new Date;return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()},u=t=>{let e=c();return t>e?e:t},w=t=>{let e=new Date,a=e.getDate(),n=e.getMonth(),r=e.getFullYear(),o=u(t);if(a<=o){let s=n===0?11:n-1,D=n===0?r-1:r;return new Date(D,s,o)}else return new Date(r,n,o)};export{l as a,g as b,m as c,f as d,h as e,y as f,c as g,u as h,w as i};
