import{Q as l}from"./vue-datepicker-DJOolBJW.js";/* empty css             */import{a as h,C as $,k as d,b,o as H,O as M,m as S,g as D,p as r,n as f,w as p,u as g}from"./convert-case-to-camel-case.utils-DDUpNI96.js";const P={class:"ccb-range-timePicker"},F={class:"ccb-range-timePicker__from"},x={class:"ccb-range-timePicker__to"},N=h({__name:"RangeTime",props:{field:{}},emits:["update:modelValue"],setup(v,{emit:k}){const V=v,m=k,{field:_}=$(V),s=d(new Date),a=d(new Date),c=b(()=>{var e,t;return((t=(e=_.value)==null?void 0:e.attributes)==null?void 0:t.format)||!1}),i=e=>{const{hours:t,minutes:o}=e,n=o.toString().padStart(2,"0");if(c.value)return`${t.toString().padStart(2,"0")}:${n}`;{const u=t>=12?"PM":"AM";return`${t%12||12}:${n} ${u}`}};return H(()=>{if(s.value instanceof Date&&a.value instanceof Date){const e={hours:s.value.getHours(),minutes:s.value.getMinutes(),seconds:s.value.getSeconds()},t={hours:a.value.getHours(),minutes:a.value.getMinutes(),seconds:a.value.getSeconds()},o=i(e),n=i(t);m("update:modelValue",`${o} - ${n}`)}}),M([s,a],e=>{if(!Array.isArray(e))return;const t=e[0]instanceof Date?{hours:e[0].getHours(),minutes:e[0].getMinutes(),seconds:e[0].getSeconds()}:e[0],o=e[1]instanceof Date?{hours:e[1].getHours(),minutes:e[1].getMinutes(),seconds:e[1].getSeconds()}:e[1],n=i(t),u=i(o);m("update:modelValue",`${n} - ${u}`)}),(e,t)=>(D(),S("div",P,[r("div",F,[f(g(l),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=o=>s.value=o),"time-picker":"","is-24":c.value,"minutes-grid-increment":"5",placeholder:"hh:mm"},{"input-icon":p(()=>t[2]||(t[2]=[r("i",{class:"ccb-icon-timepicker-light-clock"},null,-1)])),_:1},8,["modelValue","is-24"])]),t[4]||(t[4]=r("div",{class:"ccb-range-timePicker__separator"},[r("span",null,"to")],-1)),r("div",x,[f(g(l),{modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=o=>a.value=o),"time-picker":"","is-24":c.value,"minutes-grid-increment":"5",placeholder:"hh:mm"},{"input-icon":p(()=>t[3]||(t[3]=[r("i",{class:"ccb-icon-timepicker-light-clock"},null,-1)])),_:1},8,["modelValue","is-24"])])]))}});export{N as default};
//# sourceMappingURL=RangeTime-9wKWCQP1.js.map
