date.f423aacf.js 9.1 KB

1
  1. import{G as tt}from"./index.2854391f.js";var q={exports:{}};(function(a,r){(function(h,d){a.exports=d()})(tt,function(){var h=1e3,d=6e4,g=36e5,S="millisecond",M="second",y="minute",T="hour",b="day",L="week",p="month",z="quarter",O="year",F="date",B="Invalid Date",Q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,K=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var n=["th","st","nd","rd"],t=o%100;return"["+o+(n[(t-20)%10]||n[t]||n[0])+"]"}},Z=function(o,n,t){var s=String(o);return!s||s.length>=n?o:""+Array(n+1-s.length).join(t)+o},X={s:Z,z:function(o){var n=-o.utcOffset(),t=Math.abs(n),s=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+Z(s,2,"0")+":"+Z(e,2,"0")},m:function o(n,t){if(n.date()<t.date())return-o(t,n);var s=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(s,p),u=t-e<0,i=n.clone().add(s+(u?-1:1),p);return+(-(s+(t-e)/(u?e-i:i-e))||0)},a:function(o){return o<0?Math.ceil(o)||0:Math.floor(o)},p:function(o){return{M:p,y:O,w:L,d:b,D:F,h:T,m:y,s:M,ms:S,Q:z}[o]||String(o||"").toLowerCase().replace(/s$/,"")},u:function(o){return o===void 0}},W="en",k={};k[W]=R;var G=function(o){return o instanceof A},E=function o(n,t,s){var e;if(!n)return W;if(typeof n=="string"){var u=n.toLowerCase();k[u]&&(e=u),t&&(k[u]=t,e=u);var i=n.split("-");if(!e&&i.length>1)return o(i[0])}else{var f=n.name;k[f]=n,e=f}return!s&&e&&(W=e),e||!s&&W},l=function(o,n){if(G(o))return o.clone();var t=typeof n=="object"?n:{};return t.date=o,t.args=arguments,new A(t)},c=X;c.l=E,c.i=G,c.w=function(o,n){return l(o,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var A=function(){function o(t){this.$L=E(t.locale,null,!0),this.parse(t)}var n=o.prototype;return n.parse=function(t){this.$d=function(s){var e=s.date,u=s.utc;if(e===null)return new Date(NaN);if(c.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var i=e.match(Q);if(i){var f=i[2]-1||0,$=(i[7]||"0").substring(0,3);return u?new Date(Date.UTC(i[1],f,i[3]||1,i[4]||0,i[5]||0,i[6]||0,$)):new Date(i[1],f,i[3]||1,i[4]||0,i[5]||0,i[6]||0,$)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return c},n.isValid=function(){return this.$d.toString()!==B},n.isSame=function(t,s){var e=l(t);return this.startOf(s)<=e&&e<=this.endOf(s)},n.isAfter=function(t,s){return l(t)<this.startOf(s)},n.isBefore=function(t,s){return this.endOf(s)<l(t)},n.$g=function(t,s,e){return c.u(t)?this[s]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,s){var e=this,u=!!c.u(s)||s,i=c.p(t),f=function(x,w){var _=c.w(e.$u?Date.UTC(e.$y,w,x):new Date(e.$y,w,x),e);return u?_:_.endOf(b)},$=function(x,w){return c.w(e.toDate()[x].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(w)),e)},D=this.$W,m=this.$M,v=this.$D,I="set"+(this.$u?"UTC":"");switch(i){case O:return u?f(1,0):f(31,11);case p:return u?f(1,m):f(0,m+1);case L:var H=this.$locale().weekStart||0,j=(D<H?D+7:D)-H;return f(u?v-j:v+(6-j),m);case b:case F:return $(I+"Hours",0);case T:return $(I+"Minutes",1);case y:return $(I+"Seconds",2);case M:return $(I+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,s){var e,u=c.p(t),i="set"+(this.$u?"UTC":""),f=(e={},e[b]=i+"Date",e[F]=i+"Date",e[p]=i+"Month",e[O]=i+"FullYear",e[T]=i+"Hours",e[y]=i+"Minutes",e[M]=i+"Seconds",e[S]=i+"Milliseconds",e)[u],$=u===b?this.$D+(s-this.$W):s;if(u===p||u===O){var D=this.clone().set(F,1);D.$d[f]($),D.init(),this.$d=D.set(F,Math.min(this.$D,D.daysInMonth())).$d}else f&&this.$d[f]($);return this.init(),this},n.set=function(t,s){return this.clone().$set(t,s)},n.get=function(t){return this[c.p(t)]()},n.add=function(t,s){var e,u=this;t=Number(t);var i=c.p(s),f=function(m){var v=l(u);return c.w(v.date(v.date()+Math.round(m*t)),u)};if(i===p)return this.set(p,this.$M+t);if(i===O)return this.set(O,this.$y+t);if(i===b)return f(1);if(i===L)return f(7);var $=(e={},e[y]=d,e[T]=g,e[M]=h,e)[i]||1,D=this.$d.getTime()+t*$;return c.w(D,this)},n.subtract=function(t,s){return this.add(-1*t,s)},n.format=function(t){var s=this,e=this.$locale();if(!this.isValid())return e.invalidDate||B;var u=t||"YYYY-MM-DDTHH:mm:ssZ",i=c.z(this),f=this.$H,$=this.$m,D=this.$M,m=e.weekdays,v=e.months,I=e.meridiem,H=function(w,_,C,N){return w&&(w[_]||w(s,u))||C[_].slice(0,N)},j=function(w){return c.s(f%12||12,w,"0")},x=I||function(w,_,C){var N=w<12?"AM":"PM";return C?N.toLowerCase():N};return u.replace(K,function(w,_){return _||function(C){switch(C){case"YY":return String(s.$y).slice(-2);case"YYYY":return c.s(s.$y,4,"0");case"M":return D+1;case"MM":return c.s(D+1,2,"0");case"MMM":return H(e.monthsShort,D,v,3);case"MMMM":return H(v,D);case"D":return s.$D;case"DD":return c.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return H(e.weekdaysMin,s.$W,m,2);case"ddd":return H(e.weekdaysShort,s.$W,m,3);case"dddd":return m[s.$W];case"H":return String(f);case"HH":return c.s(f,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return x(f,$,!0);case"A":return x(f,$,!1);case"m":return String($);case"mm":return c.s($,2,"0");case"s":return String(s.$s);case"ss":return c.s(s.$s,2,"0");case"SSS":return c.s(s.$ms,3,"0");case"Z":return i}return null}(w)||i.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,s,e){var u,i=this,f=c.p(s),$=l(t),D=($.utcOffset()-this.utcOffset())*d,m=this-$,v=function(){return c.m(i,$)};switch(f){case O:u=v()/12;break;case p:u=v();break;case z:u=v()/3;break;case L:u=(m-D)/6048e5;break;case b:u=(m-D)/864e5;break;case T:u=m/g;break;case y:u=m/d;break;case M:u=m/h;break;default:u=m}return e?u:c.a(u)},n.daysInMonth=function(){return this.endOf(p).$D},n.$locale=function(){return k[this.$L]},n.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),u=E(t,s,!0);return u&&(e.$L=u),e},n.clone=function(){return c.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},o}(),V=A.prototype;return l.prototype=V,[["$ms",S],["$s",M],["$m",y],["$H",T],["$W",b],["$M",p],["$y",O],["$D",F]].forEach(function(o){V[o[1]]=function(n){return this.$g(n,o[0],o[1])}}),l.extend=function(o,n){return o.$i||(o(n,A,l),o.$i=!0),l},l.locale=E,l.isDayjs=G,l.unix=function(o){return l(1e3*o)},l.en=k[W],l.Ls=k,l.p={},l})})(q);var U=q.exports;U().subtract(7,"day").format("YYYY-MM-DD"),U().subtract(1,"day").format("YYYY-MM-DD");U().subtract(30,"day").format("YYYY-MM-DD"),U().subtract(1,"day").format("YYYY-MM-DD");const P=a=>{const r=new Date(a),h=r.getFullYear(),d=r.getMonth()+1,g=r.getDate(),S=r.getHours(),M=r.getMinutes(),y=r.getSeconds();return`${Y(h)}-${Y(d)}-${Y(g)} ${Y(S)}:${Y(M)}:${Y(y)}`},Y=a=>a<10?`0${a}`:a,ot=a=>{const r=new Date(a),h=r.getFullYear(),d=r.getMonth()+1,g=r.getDate();return`${Y(h)}-${Y(d)}-${Y(g)}`},ut=a=>{const r=new Date(a),h=r.getFullYear(),d=r.getMonth()+1;return`${Y(h)}-${Y(d)}`},it=a=>{const r=new Date,h=new Date(a),d=h.getFullYear(),g=h.getMonth()+1,S=r.getDate(),M=r.getMonth()+1,y=new Date(d,g,0).getDate();return{days:y,surplusDay:g>M?y:y-S}},ct=(a,r)=>{const h=new Date(a).getTime(),d=new Date(r).getTime();return Math.floor((d-h)/864e5)+1},ft=a=>{const r=new Date(parseInt(a)),h=r.getFullYear(),d=r.getMonth()+1<10?`0${r.getMonth()+1}`:r.getMonth()+1,g=r.getDate()<10?`0${r.getDate()}`:r.getDate(),S=r.getHours()<10?`0${r.getHours()}`:r.getHours(),M=r.getMinutes()<10?`0${r.getMinutes()}`:r.getMinutes(),y=r.getSeconds()<10?`0${r.getSeconds()}`:r.getSeconds();return`${h}-${d}-${g} ${S}:${M}:${y}`};function ht(){const a=new Date;return new Date(a.getTime()-1*60*60*1e3)}function dt(){const a=new Date;return new Date(a.getTime()-24*60*60*1e3)}function $t(){const a=new Date;return new Date(a.getTime()-7*24*60*60*1e3)}const gt=a=>{const r=et(a);return new Date(r).getTime()},lt=a=>{const r=nt(a);return new Date(r).getTime()},et=a=>P(new Date(`${a} 00:00:00`)),nt=a=>P(new Date(`${a} 23:59:59`)),rt=function(a){const r=a.getFullYear(),h=a.getMonth()+1,d=a.getDate(),g=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"][a.getDay()],S={date:new Date(a),dateStr:`${r}-${h.toString().padStart(2,"0")}-${d.toString().padStart(2,"0")}`,year:r,month:h,day:d,week:g,isToday:!1},M=new Date;return M.getFullYear()===r&&M.getMonth()+1===h&&M.getDate()===d&&(S.isToday=!0),S},st=function(a,r=7){const h=[],d=a.getDay()-0;a=J(a,d*-1);for(let g=0;g<r;g++)h.push(rt(g===0?a:J(a,1)));return h},J=function(a,r=0){return a.setDate(a.getDate()+r),a},Dt=({baselineDate:a,range:r=0,step:h=7})=>st(J(a,r),h);export{it as a,Dt as b,gt as c,lt as d,P as e,ct as f,ot as g,ut as h,U as i,et as j,nt as k,Y as l,ft as m,ht as n,dt as o,$t as p};