import{_ as e,b as t,d as a,p as l,w as n,i as d,o as i,f as o,k as s,C as m}from"./index-2PZN6pGH.js";import{_ as u}from"./uni-card.CpdfOoXJ.js";import{_ as r}from"./uni-section.BISPxi99.js";import{_ as g}from"./uni-datetime-picker.D-cXsysU.js";const c=e({data(){return{dateString:this.getDateTime(new Date),datetimeString:this.getDateTime(new Date),dateTimestamp:Date.now(),dateInstance:new Date,dateRange:[this.getDate(Date.now()-432e6),this.getDate(Date.now()+432e6)],datetimeRange:[this.getDateTime(Date.now()-432e6),this.getDateTime(Date.now()+432e6)],start:Date.now()-864e6,end:Date.now()+864e6}},watch:{datetimeString(){console.log("日期时间单选:",this.datetimeString)},dateRange(){console.log("日期范围选:",this.dateRange)},datetimeRange(){console.log("日期时间范围选:",this.datetimeRange)}},methods:{change(e){console.log("----change事件:",e)},maskClick(e){console.log("----maskClick事件:",e)},getDateTime(e){return`${this.getDate(e)} ${this.getTime(e)}`},getDate(e){const t=(e=new Date(e)).getFullYear(),a=e.getMonth()+1,l=e.getDate();return`${t}-${this.addZero(a)}-${this.addZero(l)}`},getTime(e){const t=(e=new Date(e)).getHours(),a=e.getMinutes(),l=e.getSeconds();return this.hideSecond?`${this.addZero(t)}:${this.addZero(a)}`:`${this.addZero(t)}:${this.addZero(a)}:${this.addZero(l)}`},addZero:e=>(e<10&&(e=`0${e}`),e)}},[["render",function(e,c,p,h,V,y){const S=m,f=t(a("uni-card"),u),D=t(a("uni-section"),r),_=t(a("uni-datetime-picker"),g),k=d;return i(),l(k,{class:"page container"},{default:n((()=>[o(f,{"is-shadow":!1,"is-full":""},{default:n((()=>[o(S,{class:"uni-h6"},{default:n((()=>[s("可以同时选择日期和时间的选择器")])),_:1})])),_:1}),o(D,{title:"日期用法："+V.dateString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{type:"date","clear-icon":!1,modelValue:V.dateString,"onUpdate:modelValue":c[0]||(c[0]=e=>V.dateString=e),onMaskClick:y.maskClick},null,8,["modelValue","onMaskClick"])])),_:1}),o(D,{title:"日期时间用法："+V.datetimeString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{type:"datetime",start:V.start,end:V.end,modelValue:V.datetimeString,"onUpdate:modelValue":c[1]||(c[1]=e=>V.datetimeString=e),onChange:y.change},null,8,["start","end","modelValue","onChange"])])),_:1}),o(D,{title:"日期范围用法：["+V.dateRange+"]",type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.dateRange,"onUpdate:modelValue":c[2]||(c[2]=e=>V.dateRange=e),type:"daterange",onMaskClick:y.maskClick},null,8,["modelValue","onMaskClick"])])),_:1}),o(D,{title:"日期时间范围用法：["+V.datetimeRange+"]",type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.datetimeRange,"onUpdate:modelValue":c[3]||(c[3]=e=>V.datetimeRange=e),type:"datetimerange",rangeSeparator:"至"},null,8,["modelValue"])])),_:1}),o(D,{title:"时间戳用法："+V.dateTimestamp,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{returnType:"timestamp",modelValue:V.dateTimestamp,"onUpdate:modelValue":c[4]||(c[4]=e=>V.dateTimestamp=e),onChange:y.change},null,8,["modelValue","onChange"])])),_:1}),o(D,{title:"date 对象用法："+V.dateInstance,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{type:"datetime",returnType:"date",modelValue:V.dateInstance,"onUpdate:modelValue":c[5]||(c[5]=e=>V.dateInstance=e),onChange:y.change},null,8,["modelValue","onChange"])])),_:1}),o(D,{title:"插槽用法："+V.dateString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.dateString,"onUpdate:modelValue":c[6]||(c[6]=e=>V.dateString=e)},{default:n((()=>[s("我是一个插槽，点击我")])),_:1},8,["modelValue"])])),_:1}),o(D,{title:"无边框用法："+V.dateString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.dateString,"onUpdate:modelValue":c[7]||(c[7]=e=>V.dateString=e),border:!1},null,8,["modelValue"])])),_:1}),o(D,{title:"隐藏清除按钮用法："+V.dateString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.dateString,"onUpdate:modelValue":c[8]||(c[8]=e=>V.dateString=e),clearIcon:!1},null,8,["modelValue"])])),_:1}),o(D,{title:"disabled用法："+V.dateString,type:"line"},null,8,["title"]),o(k,{class:"example-body"},{default:n((()=>[o(_,{modelValue:V.dateString,"onUpdate:modelValue":c[9]||(c[9]=e=>V.dateString=e),disabled:""},null,8,["modelValue"])])),_:1})])),_:1})}],["__scopeId","data-v-0c7a3ac2"]]);export{c as default};
