useNow-7dfe94f3.js 1.1 KB

1
  1. var p=Object.defineProperty,h=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var u=(n,t,e)=>t in n?p(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,c=(n,t)=>{for(var e in t||(t={}))w.call(t,e)&&u(n,e,t[e]);if(i)for(var e of i(t))M.call(t,e)&&u(n,e,t[e]);return n},d=(n,t)=>h(n,v(t));import{al as I,am as O,an as f}from"./index.js";import{r as k,G as H}from"./vue-8fccce23.js";function G(n=!0,t=1e3){let e;const o=k({year:0,month:0,week:"",day:0,hour:"",minute:0,second:0,meridiem:"",timestamp:0}),r=()=>{const a=f(),l=a.format("HH"),g=a.format("mm"),y=a.get("s");o.year=a.get("y"),o.month=a.get("M")+1>9?a.get("M")+1:"0"+(a.get("M")+1),o.week="星期"+["日","一","二","三","四","五","六"][a.day()],o.day=a.get("date")>9?a.get("date"):"0"+a.get("date"),o.hour=l,o.minute=g,o.second=y,o.meridiem=a.format("A"),o.timestamp=f().valueOf()};function m(){r(),clearInterval(e),e=setInterval(()=>r(),t)}function s(){clearInterval(e)}return I(()=>{n&&m()}),O(()=>{s()}),d(c({},H(o)),{start:m,stop:s})}export{G as u};