@akinon/akidate 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -4
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -299
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/akidate",
|
|
3
3
|
"description": "A date library for Akinon",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"clean-package": "2.2.0",
|
|
17
|
+
"copyfiles": "^2.4.1",
|
|
18
|
+
"rimraf": "^5.0.5",
|
|
19
|
+
"typescript": "^5.2.2",
|
|
20
|
+
"@akinon/vite-config": "0.4.0",
|
|
17
21
|
"@akinon/eslint-config": "0.1.0",
|
|
18
|
-
"@akinon/typescript-config": "0.
|
|
19
|
-
"@akinon/vite-config": "0.3.0"
|
|
22
|
+
"@akinon/typescript-config": "0.2.0"
|
|
20
23
|
},
|
|
21
24
|
"clean-package": "../../clean-package.config.json",
|
|
22
25
|
"types": "dist/esm/index.d.ts",
|
|
@@ -29,7 +32,10 @@
|
|
|
29
32
|
"./package.json": "./package.json"
|
|
30
33
|
},
|
|
31
34
|
"scripts": {
|
|
32
|
-
"build": "
|
|
35
|
+
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
36
|
+
"build:esm": "tsc --outDir dist/esm",
|
|
37
|
+
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
38
|
+
"copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
|
|
33
39
|
"lint": "eslint *.ts*",
|
|
34
40
|
"test": "vitest run",
|
|
35
41
|
"test:ui": "vitest --ui",
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Q=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function K(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var P={exports:{}};(function(g,tt){(function(A,T){g.exports=T()})(Q,function(){var A=1e3,T=6e4,U=36e5,I="millisecond",w="second",b="minute",O="hour",y="day",x="week",m="month",J="quarter",M="year",_="date",Z="Invalid Date",V=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|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,B={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(i){var n=["th","st","nd","rd"],t=i%100;return"["+i+(n[(t-20)%10]||n[t]||n[0])+"]"}},F=function(i,n,t){var r=String(i);return!r||r.length>=n?i:""+Array(n+1-r.length).join(t)+i},G={s:F,z:function(i){var n=-i.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+F(r,2,"0")+":"+F(e,2,"0")},m:function i(n,t){if(n.date()<t.date())return-i(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,m),s=t-e<0,u=n.clone().add(r+(s?-1:1),m);return+(-(r+(t-e)/(s?e-u:u-e))||0)},a:function(i){return i<0?Math.ceil(i)||0:Math.floor(i)},p:function(i){return{M:m,y:M,w:x,d:y,D:_,h:O,m:b,s:w,ms:I,Q:J}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(i){return i===void 0}},Y="en",p={};p[Y]=B;var z="$isDayjsObject",N=function(i){return i instanceof L||!(!i||!i[z])},C=function i(n,t,r){var e;if(!n)return Y;if(typeof n=="string"){var s=n.toLowerCase();p[s]&&(e=s),t&&(p[s]=t,e=s);var u=n.split("-");if(!e&&u.length>1)return i(u[0])}else{var o=n.name;p[o]=n,e=o}return!r&&e&&(Y=e),e||!r&&Y},f=function(i,n){if(N(i))return i.clone();var t=typeof n=="object"?n:{};return t.date=i,t.args=arguments,new L(t)},a=G;a.l=C,a.i=N,a.w=function(i,n){return f(i,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var L=function(){function i(t){this.$L=C(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var n=i.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,s=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(V);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return s?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),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 a},n.isValid=function(){return this.$d.toString()!==Z},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<f(t)},n.$g=function(t,r,e){return a.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,s=!!a.u(r)||r,u=a.p(t),o=function(S,l){var v=a.w(e.$u?Date.UTC(e.$y,l,S):new Date(e.$y,l,S),e);return s?v:v.endOf(y)},c=function(S,l){return a.w(e.toDate()[S].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},h=this.$W,d=this.$M,$=this.$D,k="set"+(this.$u?"UTC":"");switch(u){case M:return s?o(1,0):o(31,11);case m:return s?o(1,d):o(0,d+1);case x:var D=this.$locale().weekStart||0,j=(h<D?h+7:h)-D;return o(s?$-j:$+(6-j),d);case y:case _:return c(k+"Hours",0);case O:return c(k+"Minutes",1);case b:return c(k+"Seconds",2);case w:return c(k+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,s=a.p(t),u="set"+(this.$u?"UTC":""),o=(e={},e[y]=u+"Date",e[_]=u+"Date",e[m]=u+"Month",e[M]=u+"FullYear",e[O]=u+"Hours",e[b]=u+"Minutes",e[w]=u+"Seconds",e[I]=u+"Milliseconds",e)[s],c=s===y?this.$D+(r-this.$W):r;if(s===m||s===M){var h=this.clone().set(_,1);h.$d[o](c),h.init(),this.$d=h.set(_,Math.min(this.$D,h.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[a.p(t)]()},n.add=function(t,r){var e,s=this;t=Number(t);var u=a.p(r),o=function(d){var $=f(s);return a.w($.date($.date()+Math.round(d*t)),s)};if(u===m)return this.set(m,this.$M+t);if(u===M)return this.set(M,this.$y+t);if(u===y)return o(1);if(u===x)return o(7);var c=(e={},e[b]=T,e[O]=U,e[w]=A,e)[u]||1,h=this.$d.getTime()+t*c;return a.w(h,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var s=t||"YYYY-MM-DDTHH:mm:ssZ",u=a.z(this),o=this.$H,c=this.$m,h=this.$M,d=e.weekdays,$=e.months,k=e.meridiem,D=function(l,v,H,W){return l&&(l[v]||l(r,s))||H[v].slice(0,W)},j=function(l){return a.s(o%12||12,l,"0")},S=k||function(l,v,H){var W=l<12?"AM":"PM";return H?W.toLowerCase():W};return s.replace(q,function(l,v){return v||function(H){switch(H){case"YY":return String(r.$y).slice(-2);case"YYYY":return a.s(r.$y,4,"0");case"M":return h+1;case"MM":return a.s(h+1,2,"0");case"MMM":return D(e.monthsShort,h,$,3);case"MMMM":return D($,h);case"D":return r.$D;case"DD":return a.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return D(e.weekdaysMin,r.$W,d,2);case"ddd":return D(e.weekdaysShort,r.$W,d,3);case"dddd":return d[r.$W];case"H":return String(o);case"HH":return a.s(o,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return S(o,c,!0);case"A":return S(o,c,!1);case"m":return String(c);case"mm":return a.s(c,2,"0");case"s":return String(r.$s);case"ss":return a.s(r.$s,2,"0");case"SSS":return a.s(r.$ms,3,"0");case"Z":return u}return null}(l)||u.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var s,u=this,o=a.p(r),c=f(t),h=(c.utcOffset()-this.utcOffset())*T,d=this-c,$=function(){return a.m(u,c)};switch(o){case M:s=$()/12;break;case m:s=$();break;case J:s=$()/3;break;case x:s=(d-h)/6048e5;break;case y:s=(d-h)/864e5;break;case O:s=d/U;break;case b:s=d/T;break;case w:s=d/A;break;default:s=d}return e?s:a.a(s)},n.daysInMonth=function(){return this.endOf(m).$D},n.$locale=function(){return p[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),s=C(t,r,!0);return s&&(e.$L=s),e},n.clone=function(){return a.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()},i}(),E=L.prototype;return f.prototype=E,[["$ms",I],["$s",w],["$m",b],["$H",O],["$W",y],["$M",m],["$y",M],["$D",_]].forEach(function(i){E[i[1]]=function(n){return this.$g(n,i[0],i[1])}}),f.extend=function(i,n){return i.$i||(i(n,L,f),i.$i=!0),f},f.locale=C,f.isDayjs=N,f.unix=function(i){return f(1e3*i)},f.en=p[Y],f.Ls=p,f.p={},f})})(P);var R=P.exports;const X=K(R);exports.akidate=X;
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,YAAY,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
var Q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function K(g) {
|
|
3
|
-
return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
|
|
4
|
-
}
|
|
5
|
-
var V = { exports: {} };
|
|
6
|
-
(function(g, X) {
|
|
7
|
-
(function(A, T) {
|
|
8
|
-
g.exports = T();
|
|
9
|
-
})(Q, function() {
|
|
10
|
-
var A = 1e3, T = 6e4, U = 36e5, I = "millisecond", S = "second", b = "minute", O = "hour", y = "day", x = "week", m = "month", J = "quarter", M = "year", _ = "date", Z = "Invalid Date", P = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, q = /\[([^\]]+)]|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, B = { 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(i) {
|
|
11
|
-
var n = ["th", "st", "nd", "rd"], t = i % 100;
|
|
12
|
-
return "[" + i + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
|
|
13
|
-
} }, F = function(i, n, t) {
|
|
14
|
-
var r = String(i);
|
|
15
|
-
return !r || r.length >= n ? i : "" + Array(n + 1 - r.length).join(t) + i;
|
|
16
|
-
}, G = { s: F, z: function(i) {
|
|
17
|
-
var n = -i.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
|
|
18
|
-
return (n <= 0 ? "+" : "-") + F(r, 2, "0") + ":" + F(e, 2, "0");
|
|
19
|
-
}, m: function i(n, t) {
|
|
20
|
-
if (n.date() < t.date())
|
|
21
|
-
return -i(t, n);
|
|
22
|
-
var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, m), s = t - e < 0, u = n.clone().add(r + (s ? -1 : 1), m);
|
|
23
|
-
return +(-(r + (t - e) / (s ? e - u : u - e)) || 0);
|
|
24
|
-
}, a: function(i) {
|
|
25
|
-
return i < 0 ? Math.ceil(i) || 0 : Math.floor(i);
|
|
26
|
-
}, p: function(i) {
|
|
27
|
-
return { M: m, y: M, w: x, d: y, D: _, h: O, m: b, s: S, ms: I, Q: J }[i] || String(i || "").toLowerCase().replace(/s$/, "");
|
|
28
|
-
}, u: function(i) {
|
|
29
|
-
return i === void 0;
|
|
30
|
-
} }, Y = "en", p = {};
|
|
31
|
-
p[Y] = B;
|
|
32
|
-
var z = "$isDayjsObject", N = function(i) {
|
|
33
|
-
return i instanceof L || !(!i || !i[z]);
|
|
34
|
-
}, C = function i(n, t, r) {
|
|
35
|
-
var e;
|
|
36
|
-
if (!n)
|
|
37
|
-
return Y;
|
|
38
|
-
if (typeof n == "string") {
|
|
39
|
-
var s = n.toLowerCase();
|
|
40
|
-
p[s] && (e = s), t && (p[s] = t, e = s);
|
|
41
|
-
var u = n.split("-");
|
|
42
|
-
if (!e && u.length > 1)
|
|
43
|
-
return i(u[0]);
|
|
44
|
-
} else {
|
|
45
|
-
var o = n.name;
|
|
46
|
-
p[o] = n, e = o;
|
|
47
|
-
}
|
|
48
|
-
return !r && e && (Y = e), e || !r && Y;
|
|
49
|
-
}, f = function(i, n) {
|
|
50
|
-
if (N(i))
|
|
51
|
-
return i.clone();
|
|
52
|
-
var t = typeof n == "object" ? n : {};
|
|
53
|
-
return t.date = i, t.args = arguments, new L(t);
|
|
54
|
-
}, a = G;
|
|
55
|
-
a.l = C, a.i = N, a.w = function(i, n) {
|
|
56
|
-
return f(i, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
|
|
57
|
-
};
|
|
58
|
-
var L = function() {
|
|
59
|
-
function i(t) {
|
|
60
|
-
this.$L = C(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[z] = !0;
|
|
61
|
-
}
|
|
62
|
-
var n = i.prototype;
|
|
63
|
-
return n.parse = function(t) {
|
|
64
|
-
this.$d = function(r) {
|
|
65
|
-
var e = r.date, s = r.utc;
|
|
66
|
-
if (e === null)
|
|
67
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
68
|
-
if (a.u(e))
|
|
69
|
-
return /* @__PURE__ */ new Date();
|
|
70
|
-
if (e instanceof Date)
|
|
71
|
-
return new Date(e);
|
|
72
|
-
if (typeof e == "string" && !/Z$/i.test(e)) {
|
|
73
|
-
var u = e.match(P);
|
|
74
|
-
if (u) {
|
|
75
|
-
var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
|
|
76
|
-
return s ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return new Date(e);
|
|
80
|
-
}(t), this.init();
|
|
81
|
-
}, n.init = function() {
|
|
82
|
-
var t = this.$d;
|
|
83
|
-
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();
|
|
84
|
-
}, n.$utils = function() {
|
|
85
|
-
return a;
|
|
86
|
-
}, n.isValid = function() {
|
|
87
|
-
return this.$d.toString() !== Z;
|
|
88
|
-
}, n.isSame = function(t, r) {
|
|
89
|
-
var e = f(t);
|
|
90
|
-
return this.startOf(r) <= e && e <= this.endOf(r);
|
|
91
|
-
}, n.isAfter = function(t, r) {
|
|
92
|
-
return f(t) < this.startOf(r);
|
|
93
|
-
}, n.isBefore = function(t, r) {
|
|
94
|
-
return this.endOf(r) < f(t);
|
|
95
|
-
}, n.$g = function(t, r, e) {
|
|
96
|
-
return a.u(t) ? this[r] : this.set(e, t);
|
|
97
|
-
}, n.unix = function() {
|
|
98
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
99
|
-
}, n.valueOf = function() {
|
|
100
|
-
return this.$d.getTime();
|
|
101
|
-
}, n.startOf = function(t, r) {
|
|
102
|
-
var e = this, s = !!a.u(r) || r, u = a.p(t), o = function(w, l) {
|
|
103
|
-
var v = a.w(e.$u ? Date.UTC(e.$y, l, w) : new Date(e.$y, l, w), e);
|
|
104
|
-
return s ? v : v.endOf(y);
|
|
105
|
-
}, c = function(w, l) {
|
|
106
|
-
return a.w(e.toDate()[w].apply(e.toDate("s"), (s ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(l)), e);
|
|
107
|
-
}, h = this.$W, d = this.$M, $ = this.$D, k = "set" + (this.$u ? "UTC" : "");
|
|
108
|
-
switch (u) {
|
|
109
|
-
case M:
|
|
110
|
-
return s ? o(1, 0) : o(31, 11);
|
|
111
|
-
case m:
|
|
112
|
-
return s ? o(1, d) : o(0, d + 1);
|
|
113
|
-
case x:
|
|
114
|
-
var D = this.$locale().weekStart || 0, H = (h < D ? h + 7 : h) - D;
|
|
115
|
-
return o(s ? $ - H : $ + (6 - H), d);
|
|
116
|
-
case y:
|
|
117
|
-
case _:
|
|
118
|
-
return c(k + "Hours", 0);
|
|
119
|
-
case O:
|
|
120
|
-
return c(k + "Minutes", 1);
|
|
121
|
-
case b:
|
|
122
|
-
return c(k + "Seconds", 2);
|
|
123
|
-
case S:
|
|
124
|
-
return c(k + "Milliseconds", 3);
|
|
125
|
-
default:
|
|
126
|
-
return this.clone();
|
|
127
|
-
}
|
|
128
|
-
}, n.endOf = function(t) {
|
|
129
|
-
return this.startOf(t, !1);
|
|
130
|
-
}, n.$set = function(t, r) {
|
|
131
|
-
var e, s = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[y] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[M] = u + "FullYear", e[O] = u + "Hours", e[b] = u + "Minutes", e[S] = u + "Seconds", e[I] = u + "Milliseconds", e)[s], c = s === y ? this.$D + (r - this.$W) : r;
|
|
132
|
-
if (s === m || s === M) {
|
|
133
|
-
var h = this.clone().set(_, 1);
|
|
134
|
-
h.$d[o](c), h.init(), this.$d = h.set(_, Math.min(this.$D, h.daysInMonth())).$d;
|
|
135
|
-
} else
|
|
136
|
-
o && this.$d[o](c);
|
|
137
|
-
return this.init(), this;
|
|
138
|
-
}, n.set = function(t, r) {
|
|
139
|
-
return this.clone().$set(t, r);
|
|
140
|
-
}, n.get = function(t) {
|
|
141
|
-
return this[a.p(t)]();
|
|
142
|
-
}, n.add = function(t, r) {
|
|
143
|
-
var e, s = this;
|
|
144
|
-
t = Number(t);
|
|
145
|
-
var u = a.p(r), o = function(d) {
|
|
146
|
-
var $ = f(s);
|
|
147
|
-
return a.w($.date($.date() + Math.round(d * t)), s);
|
|
148
|
-
};
|
|
149
|
-
if (u === m)
|
|
150
|
-
return this.set(m, this.$M + t);
|
|
151
|
-
if (u === M)
|
|
152
|
-
return this.set(M, this.$y + t);
|
|
153
|
-
if (u === y)
|
|
154
|
-
return o(1);
|
|
155
|
-
if (u === x)
|
|
156
|
-
return o(7);
|
|
157
|
-
var c = (e = {}, e[b] = T, e[O] = U, e[S] = A, e)[u] || 1, h = this.$d.getTime() + t * c;
|
|
158
|
-
return a.w(h, this);
|
|
159
|
-
}, n.subtract = function(t, r) {
|
|
160
|
-
return this.add(-1 * t, r);
|
|
161
|
-
}, n.format = function(t) {
|
|
162
|
-
var r = this, e = this.$locale();
|
|
163
|
-
if (!this.isValid())
|
|
164
|
-
return e.invalidDate || Z;
|
|
165
|
-
var s = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, $ = e.months, k = e.meridiem, D = function(l, v, j, W) {
|
|
166
|
-
return l && (l[v] || l(r, s)) || j[v].slice(0, W);
|
|
167
|
-
}, H = function(l) {
|
|
168
|
-
return a.s(o % 12 || 12, l, "0");
|
|
169
|
-
}, w = k || function(l, v, j) {
|
|
170
|
-
var W = l < 12 ? "AM" : "PM";
|
|
171
|
-
return j ? W.toLowerCase() : W;
|
|
172
|
-
};
|
|
173
|
-
return s.replace(q, function(l, v) {
|
|
174
|
-
return v || function(j) {
|
|
175
|
-
switch (j) {
|
|
176
|
-
case "YY":
|
|
177
|
-
return String(r.$y).slice(-2);
|
|
178
|
-
case "YYYY":
|
|
179
|
-
return a.s(r.$y, 4, "0");
|
|
180
|
-
case "M":
|
|
181
|
-
return h + 1;
|
|
182
|
-
case "MM":
|
|
183
|
-
return a.s(h + 1, 2, "0");
|
|
184
|
-
case "MMM":
|
|
185
|
-
return D(e.monthsShort, h, $, 3);
|
|
186
|
-
case "MMMM":
|
|
187
|
-
return D($, h);
|
|
188
|
-
case "D":
|
|
189
|
-
return r.$D;
|
|
190
|
-
case "DD":
|
|
191
|
-
return a.s(r.$D, 2, "0");
|
|
192
|
-
case "d":
|
|
193
|
-
return String(r.$W);
|
|
194
|
-
case "dd":
|
|
195
|
-
return D(e.weekdaysMin, r.$W, d, 2);
|
|
196
|
-
case "ddd":
|
|
197
|
-
return D(e.weekdaysShort, r.$W, d, 3);
|
|
198
|
-
case "dddd":
|
|
199
|
-
return d[r.$W];
|
|
200
|
-
case "H":
|
|
201
|
-
return String(o);
|
|
202
|
-
case "HH":
|
|
203
|
-
return a.s(o, 2, "0");
|
|
204
|
-
case "h":
|
|
205
|
-
return H(1);
|
|
206
|
-
case "hh":
|
|
207
|
-
return H(2);
|
|
208
|
-
case "a":
|
|
209
|
-
return w(o, c, !0);
|
|
210
|
-
case "A":
|
|
211
|
-
return w(o, c, !1);
|
|
212
|
-
case "m":
|
|
213
|
-
return String(c);
|
|
214
|
-
case "mm":
|
|
215
|
-
return a.s(c, 2, "0");
|
|
216
|
-
case "s":
|
|
217
|
-
return String(r.$s);
|
|
218
|
-
case "ss":
|
|
219
|
-
return a.s(r.$s, 2, "0");
|
|
220
|
-
case "SSS":
|
|
221
|
-
return a.s(r.$ms, 3, "0");
|
|
222
|
-
case "Z":
|
|
223
|
-
return u;
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
}(l) || u.replace(":", "");
|
|
227
|
-
});
|
|
228
|
-
}, n.utcOffset = function() {
|
|
229
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
230
|
-
}, n.diff = function(t, r, e) {
|
|
231
|
-
var s, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * T, d = this - c, $ = function() {
|
|
232
|
-
return a.m(u, c);
|
|
233
|
-
};
|
|
234
|
-
switch (o) {
|
|
235
|
-
case M:
|
|
236
|
-
s = $() / 12;
|
|
237
|
-
break;
|
|
238
|
-
case m:
|
|
239
|
-
s = $();
|
|
240
|
-
break;
|
|
241
|
-
case J:
|
|
242
|
-
s = $() / 3;
|
|
243
|
-
break;
|
|
244
|
-
case x:
|
|
245
|
-
s = (d - h) / 6048e5;
|
|
246
|
-
break;
|
|
247
|
-
case y:
|
|
248
|
-
s = (d - h) / 864e5;
|
|
249
|
-
break;
|
|
250
|
-
case O:
|
|
251
|
-
s = d / U;
|
|
252
|
-
break;
|
|
253
|
-
case b:
|
|
254
|
-
s = d / T;
|
|
255
|
-
break;
|
|
256
|
-
case S:
|
|
257
|
-
s = d / A;
|
|
258
|
-
break;
|
|
259
|
-
default:
|
|
260
|
-
s = d;
|
|
261
|
-
}
|
|
262
|
-
return e ? s : a.a(s);
|
|
263
|
-
}, n.daysInMonth = function() {
|
|
264
|
-
return this.endOf(m).$D;
|
|
265
|
-
}, n.$locale = function() {
|
|
266
|
-
return p[this.$L];
|
|
267
|
-
}, n.locale = function(t, r) {
|
|
268
|
-
if (!t)
|
|
269
|
-
return this.$L;
|
|
270
|
-
var e = this.clone(), s = C(t, r, !0);
|
|
271
|
-
return s && (e.$L = s), e;
|
|
272
|
-
}, n.clone = function() {
|
|
273
|
-
return a.w(this.$d, this);
|
|
274
|
-
}, n.toDate = function() {
|
|
275
|
-
return new Date(this.valueOf());
|
|
276
|
-
}, n.toJSON = function() {
|
|
277
|
-
return this.isValid() ? this.toISOString() : null;
|
|
278
|
-
}, n.toISOString = function() {
|
|
279
|
-
return this.$d.toISOString();
|
|
280
|
-
}, n.toString = function() {
|
|
281
|
-
return this.$d.toUTCString();
|
|
282
|
-
}, i;
|
|
283
|
-
}(), E = L.prototype;
|
|
284
|
-
return f.prototype = E, [["$ms", I], ["$s", S], ["$m", b], ["$H", O], ["$W", y], ["$M", m], ["$y", M], ["$D", _]].forEach(function(i) {
|
|
285
|
-
E[i[1]] = function(n) {
|
|
286
|
-
return this.$g(n, i[0], i[1]);
|
|
287
|
-
};
|
|
288
|
-
}), f.extend = function(i, n) {
|
|
289
|
-
return i.$i || (i(n, L, f), i.$i = !0), f;
|
|
290
|
-
}, f.locale = C, f.isDayjs = N, f.unix = function(i) {
|
|
291
|
-
return f(1e3 * i);
|
|
292
|
-
}, f.en = p[Y], f.Ls = p, f.p = {}, f;
|
|
293
|
-
});
|
|
294
|
-
})(V);
|
|
295
|
-
var R = V.exports;
|
|
296
|
-
const tt = /* @__PURE__ */ K(R);
|
|
297
|
-
export {
|
|
298
|
-
tt as akidate
|
|
299
|
-
};
|