import{e as y,f as s,t as p,p as f,F as g,q as Y,g as _,c as o,o as m}from"./iframe-Bl-fVlm8.js";import{_ as z}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M=["datetime"],P={key:0,class:"pz-date__date"},H={class:"pz-date__time"},i=2,n=y({name:"PzDate",__name:"PzDate",props:{date:{},format:{default:"DD MM YYYY HH:mm"},typography:{}},setup(r){const t=r,u=o(()=>{if(!t.date)return null;const e=new Date(t.date.replace(" ","T"));return isNaN(e.getTime())?null:e}),c=o(()=>{const e=u.value;return e?t.format==="YYYY"?new Intl.DateTimeFormat("uk-UA",{year:"numeric"}).format(e):t.format==="MM YYYY"?new Intl.DateTimeFormat("uk-UA",{month:"long",year:"numeric"}).format(e):new Intl.DateTimeFormat("uk-UA",{day:"numeric",month:"long",year:"numeric"}).format(e):""}),d=o(()=>{const e=u.value;if(!e||t.format!=="DD MM YYYY HH:mm"&&t.format!=="DD MM YYYY HH:mm:ss")return"";const a=String(e.getHours()).padStart(i,"0"),l=String(e.getMinutes()).padStart(i,"0");if(t.format==="DD MM YYYY HH:mm:ss"){const D=String(e.getSeconds()).padStart(i,"0");return`${a}:${l}:${D}`}return`${a}:${l}`});return(e,a)=>(m(),s("time",{class:_(["pz-date",r.typography?`pz-typography--${r.typography}`:null]),datetime:r.date},[c.value?(m(),s("span",P,p(c.value),1)):f("",!0),d.value?(m(),s(g,{key:1},[a[0]||(a[0]=Y("i",{class:"pz-date__separator","aria-hidden":"true"},null,-1)),Y("span",H,p(d.value),1)],64)):f("",!0)],10,M))}}),N=z(n,[["__scopeId","data-v-70b8e315"]]);n.__docgenInfo=Object.assign({displayName:n.name??n.__name},{name:"PzDate",exportName:"default",displayName:"PzDate",description:"",tags:{},props:[{name:"date",required:!0,type:{name:"string"}},{name:"format",required:!1,type:{name:"PzDateFormat"},defaultValue:{func:!1,value:'"DD MM YYYY HH:mm"'}},{name:"typography",required:!1,type:{name:"PzTextVariant"}}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Display/PzDate/PzDate.vue"]});export{N as P};
