dayjs.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. import {
  2. __commonJS,
  3. init_define_APP_INFO
  4. } from "./chunk-XY75H3MP.js";
  5. // node_modules/dayjs/dayjs.min.js
  6. var require_dayjs_min = __commonJS({
  7. "node_modules/dayjs/dayjs.min.js"(exports, module) {
  8. init_define_APP_INFO();
  9. !function(t, e) {
  10. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
  11. }(exports, function() {
  12. "use strict";
  13. var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|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, M = { 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("_") }, m = function(t2, e2, n2) {
  14. var r2 = String(t2);
  15. return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
  16. }, g = { s: m, z: function(t2) {
  17. var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
  18. return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
  19. }, m: function t2(e2, n2) {
  20. if (e2.date() < n2.date())
  21. return -t2(n2, e2);
  22. var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
  23. return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
  24. }, a: function(t2) {
  25. return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
  26. }, p: function(t2) {
  27. return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
  28. }, u: function(t2) {
  29. return void 0 === t2;
  30. } }, v = "en", D = {};
  31. D[v] = M;
  32. var p = function(t2) {
  33. return t2 instanceof _;
  34. }, S = function t2(e2, n2, r2) {
  35. var i2;
  36. if (!e2)
  37. return v;
  38. if ("string" == typeof e2) {
  39. var s2 = e2.toLowerCase();
  40. D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
  41. var u2 = e2.split("-");
  42. if (!i2 && u2.length > 1)
  43. return t2(u2[0]);
  44. } else {
  45. var a2 = e2.name;
  46. D[a2] = e2, i2 = a2;
  47. }
  48. return !r2 && i2 && (v = i2), i2 || !r2 && v;
  49. }, w = function(t2, e2) {
  50. if (p(t2))
  51. return t2.clone();
  52. var n2 = "object" == typeof e2 ? e2 : {};
  53. return n2.date = t2, n2.args = arguments, new _(n2);
  54. }, O = g;
  55. O.l = S, O.i = p, O.w = function(t2, e2) {
  56. return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
  57. };
  58. var _ = function() {
  59. function M2(t2) {
  60. this.$L = S(t2.locale, null, true), this.parse(t2);
  61. }
  62. var m2 = M2.prototype;
  63. return m2.parse = function(t2) {
  64. this.$d = function(t3) {
  65. var e2 = t3.date, n2 = t3.utc;
  66. if (null === e2)
  67. return new Date(NaN);
  68. if (O.u(e2))
  69. return new Date();
  70. if (e2 instanceof Date)
  71. return new Date(e2);
  72. if ("string" == typeof e2 && !/Z$/i.test(e2)) {
  73. var r2 = e2.match(l);
  74. if (r2) {
  75. var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
  76. return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
  77. }
  78. }
  79. return new Date(e2);
  80. }(t2), this.$x = t2.x || {}, this.init();
  81. }, m2.init = function() {
  82. var t2 = this.$d;
  83. this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
  84. }, m2.$utils = function() {
  85. return O;
  86. }, m2.isValid = function() {
  87. return !(this.$d.toString() === $);
  88. }, m2.isSame = function(t2, e2) {
  89. var n2 = w(t2);
  90. return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
  91. }, m2.isAfter = function(t2, e2) {
  92. return w(t2) < this.startOf(e2);
  93. }, m2.isBefore = function(t2, e2) {
  94. return this.endOf(e2) < w(t2);
  95. }, m2.$g = function(t2, e2, n2) {
  96. return O.u(t2) ? this[e2] : this.set(n2, t2);
  97. }, m2.unix = function() {
  98. return Math.floor(this.valueOf() / 1e3);
  99. }, m2.valueOf = function() {
  100. return this.$d.getTime();
  101. }, m2.startOf = function(t2, e2) {
  102. var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), $2 = function(t3, e3) {
  103. var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
  104. return r2 ? i2 : i2.endOf(a);
  105. }, l2 = function(t3, e3) {
  106. return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
  107. }, y2 = this.$W, M3 = this.$M, m3 = this.$D, g2 = "set" + (this.$u ? "UTC" : "");
  108. switch (h2) {
  109. case c:
  110. return r2 ? $2(1, 0) : $2(31, 11);
  111. case f:
  112. return r2 ? $2(1, M3) : $2(0, M3 + 1);
  113. case o:
  114. var v2 = this.$locale().weekStart || 0, D2 = (y2 < v2 ? y2 + 7 : y2) - v2;
  115. return $2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
  116. case a:
  117. case d:
  118. return l2(g2 + "Hours", 0);
  119. case u:
  120. return l2(g2 + "Minutes", 1);
  121. case s:
  122. return l2(g2 + "Seconds", 2);
  123. case i:
  124. return l2(g2 + "Milliseconds", 3);
  125. default:
  126. return this.clone();
  127. }
  128. }, m2.endOf = function(t2) {
  129. return this.startOf(t2, false);
  130. }, m2.$set = function(t2, e2) {
  131. var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), $2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], l2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
  132. if (o2 === f || o2 === c) {
  133. var y2 = this.clone().set(d, 1);
  134. y2.$d[$2](l2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
  135. } else
  136. $2 && this.$d[$2](l2);
  137. return this.init(), this;
  138. }, m2.set = function(t2, e2) {
  139. return this.clone().$set(t2, e2);
  140. }, m2.get = function(t2) {
  141. return this[O.p(t2)]();
  142. }, m2.add = function(r2, h2) {
  143. var d2, $2 = this;
  144. r2 = Number(r2);
  145. var l2 = O.p(h2), y2 = function(t2) {
  146. var e2 = w($2);
  147. return O.w(e2.date(e2.date() + Math.round(t2 * r2)), $2);
  148. };
  149. if (l2 === f)
  150. return this.set(f, this.$M + r2);
  151. if (l2 === c)
  152. return this.set(c, this.$y + r2);
  153. if (l2 === a)
  154. return y2(1);
  155. if (l2 === o)
  156. return y2(7);
  157. var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[l2] || 1, m3 = this.$d.getTime() + r2 * M3;
  158. return O.w(m3, this);
  159. }, m2.subtract = function(t2, e2) {
  160. return this.add(-1 * t2, e2);
  161. }, m2.format = function(t2) {
  162. var e2 = this, n2 = this.$locale();
  163. if (!this.isValid())
  164. return n2.invalidDate || $;
  165. var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) {
  166. return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
  167. }, c2 = function(t3) {
  168. return O.s(s2 % 12 || 12, t3, "0");
  169. }, d2 = n2.meridiem || function(t3, e3, n3) {
  170. var r3 = t3 < 12 ? "AM" : "PM";
  171. return n3 ? r3.toLowerCase() : r3;
  172. }, l2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
  173. return r2.replace(y, function(t3, e3) {
  174. return e3 || l2[t3] || i2.replace(":", "");
  175. });
  176. }, m2.utcOffset = function() {
  177. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  178. }, m2.diff = function(r2, d2, $2) {
  179. var l2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, g2 = this - M3, v2 = O.m(this, M3);
  180. return v2 = (l2 = {}, l2[c] = v2 / 12, l2[f] = v2, l2[h] = v2 / 3, l2[o] = (g2 - m3) / 6048e5, l2[a] = (g2 - m3) / 864e5, l2[u] = g2 / n, l2[s] = g2 / e, l2[i] = g2 / t, l2)[y2] || g2, $2 ? v2 : O.a(v2);
  181. }, m2.daysInMonth = function() {
  182. return this.endOf(f).$D;
  183. }, m2.$locale = function() {
  184. return D[this.$L];
  185. }, m2.locale = function(t2, e2) {
  186. if (!t2)
  187. return this.$L;
  188. var n2 = this.clone(), r2 = S(t2, e2, true);
  189. return r2 && (n2.$L = r2), n2;
  190. }, m2.clone = function() {
  191. return O.w(this.$d, this);
  192. }, m2.toDate = function() {
  193. return new Date(this.valueOf());
  194. }, m2.toJSON = function() {
  195. return this.isValid() ? this.toISOString() : null;
  196. }, m2.toISOString = function() {
  197. return this.$d.toISOString();
  198. }, m2.toString = function() {
  199. return this.$d.toUTCString();
  200. }, M2;
  201. }(), T = _.prototype;
  202. return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
  203. T[t2[1]] = function(e2) {
  204. return this.$g(e2, t2[0], t2[1]);
  205. };
  206. }), w.extend = function(t2, e2) {
  207. return t2.$i || (t2(e2, _, w), t2.$i = true), w;
  208. }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
  209. return w(1e3 * t2);
  210. }, w.en = D[v], w.Ls = D, w.p = {}, w;
  211. });
  212. }
  213. });
  214. // dep:dayjs
  215. init_define_APP_INFO();
  216. var dayjs_default = require_dayjs_min();
  217. export {
  218. dayjs_default as default
  219. };
  220. //# sourceMappingURL=dayjs.js.map