import{_ as c,d as i,p as u,m as g,Y as h,G as p,f as y,o as v,bA as _}from"./app-BOG5ezKh.js";const b=i({props:{dateRange:{default:[]},formatType:{default:"YYYY-MM-DD HH:mm:ss"},showPreset:{default:!0,type:Boolean}},emits:["dateTimeChanged"],setup(e,{emit:s}){const d=u([]),{appSetting:o,dayjs:a}=g(),{t}=h();p(()=>{e.dateRange&&e.dateRange.length>0&&(d.value=[a(e.dateRange[0]),a(e.dateRange[1])]),e.showPreset||(m.value=[])});const r=n=>{n?s("dateTimeChanged",[n[0].tz(o.value.timezone).startOf("day").utc().format(e.formatType),n[1].tz(o.value.timezone).endOf("day").utc().format(e.formatType)]):s("dateTimeChanged",[])},l=()=>{d.value=[]},f=n=>{d.value=n,r(n)},m=u([{label:t("dashboard.yesterday"),value:[a().add(-1,"d").startOf("day"),a().add(-1,"d").endOf("day")]},{label:t("dashboard.today"),value:[a(),a()]},{label:t("dashboard.last_7_days"),value:[a().add(-7,"d"),a()]},{label:t("dashboard.this_month"),value:[a().startOf("month"),a()]},{label:t("dashboard.this_year"),value:[a().startOf("year"),a()]}]);return{appSetting:o,dateRangeValue:d,dateTimeChanged:r,resetPicker:l,setDatePicker:f,rangePresets:m}}});function R(e,s,d,o,a,t){const r=_;return v(),y(r,{value:e.dateRangeValue,"onUpdate:value":s[0]||(s[0]=l=>e.dateRangeValue=l),format:e.appSetting.date_format,placeholder:[e.$t("common.start_date"),e.$t("common.end_date")],style:{width:"100%"},onChange:e.dateTimeChanged,presets:e.rangePresets},null,8,["value","format","placeholder","onChange","presets"])}const P=c(b,[["render",R],["__file","/Users/rajeshkumawat/sites/stockifly/resources/js/common/components/common/calendar/DateRangePicker.vue"]]);export{P as D};
