dayjs.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. var __getOwnPropNames = Object.getOwnPropertyNames;
  2. var __commonJS = (cb, mod) => function __require() {
  3. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  4. };
  5. // ../../../HBuilderProjects/YTAPP/node_modules/dayjs/dayjs.min.js
  6. var require_dayjs_min = __commonJS({
  7. "../../../HBuilderProjects/YTAPP/node_modules/dayjs/dayjs.min.js"(exports, module) {
  8. !function(t, e) {
  9. "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();
  10. }(exports, function() {
  11. "use strict";
  12. var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\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("_"), ordinal: function(t2) {
  13. var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
  14. return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
  15. } }, m = function(t2, e2, n2) {
  16. var r2 = String(t2);
  17. return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
  18. }, v = { s: m, z: function(t2) {
  19. var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
  20. return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
  21. }, m: function t2(e2, n2) {
  22. if (e2.date() < n2.date())
  23. return -t2(n2, e2);
  24. var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
  25. return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
  26. }, a: function(t2) {
  27. return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
  28. }, p: function(t2) {
  29. return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
  30. }, u: function(t2) {
  31. return void 0 === t2;
  32. } }, g = "en", D = {};
  33. D[g] = M;
  34. var p = "$isDayjsObject", S = function(t2) {
  35. return t2 instanceof _ || !(!t2 || !t2[p]);
  36. }, w = function t2(e2, n2, r2) {
  37. var i2;
  38. if (!e2)
  39. return g;
  40. if ("string" == typeof e2) {
  41. var s2 = e2.toLowerCase();
  42. D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
  43. var u2 = e2.split("-");
  44. if (!i2 && u2.length > 1)
  45. return t2(u2[0]);
  46. } else {
  47. var a2 = e2.name;
  48. D[a2] = e2, i2 = a2;
  49. }
  50. return !r2 && i2 && (g = i2), i2 || !r2 && g;
  51. }, O = function(t2, e2) {
  52. if (S(t2))
  53. return t2.clone();
  54. var n2 = "object" == typeof e2 ? e2 : {};
  55. return n2.date = t2, n2.args = arguments, new _(n2);
  56. }, b = v;
  57. b.l = w, b.i = S, b.w = function(t2, e2) {
  58. return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
  59. };
  60. var _ = function() {
  61. function M2(t2) {
  62. this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
  63. }
  64. var m2 = M2.prototype;
  65. return m2.parse = function(t2) {
  66. this.$d = function(t3) {
  67. var e2 = t3.date, n2 = t3.utc;
  68. if (null === e2)
  69. return /* @__PURE__ */ new Date(NaN);
  70. if (b.u(e2))
  71. return /* @__PURE__ */ new Date();
  72. if (e2 instanceof Date)
  73. return new Date(e2);
  74. if ("string" == typeof e2 && !/Z$/i.test(e2)) {
  75. var r2 = e2.match($);
  76. if (r2) {
  77. var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
  78. 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);
  79. }
  80. }
  81. return new Date(e2);
  82. }(t2), this.init();
  83. }, m2.init = function() {
  84. var t2 = this.$d;
  85. 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();
  86. }, m2.$utils = function() {
  87. return b;
  88. }, m2.isValid = function() {
  89. return !(this.$d.toString() === l);
  90. }, m2.isSame = function(t2, e2) {
  91. var n2 = O(t2);
  92. return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
  93. }, m2.isAfter = function(t2, e2) {
  94. return O(t2) < this.startOf(e2);
  95. }, m2.isBefore = function(t2, e2) {
  96. return this.endOf(e2) < O(t2);
  97. }, m2.$g = function(t2, e2, n2) {
  98. return b.u(t2) ? this[e2] : this.set(n2, t2);
  99. }, m2.unix = function() {
  100. return Math.floor(this.valueOf() / 1e3);
  101. }, m2.valueOf = function() {
  102. return this.$d.getTime();
  103. }, m2.startOf = function(t2, e2) {
  104. var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
  105. var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
  106. return r2 ? i2 : i2.endOf(a);
  107. }, $2 = function(t3, e3) {
  108. return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
  109. }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
  110. switch (f2) {
  111. case h:
  112. return r2 ? l2(1, 0) : l2(31, 11);
  113. case c:
  114. return r2 ? l2(1, M3) : l2(0, M3 + 1);
  115. case o:
  116. var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
  117. return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
  118. case a:
  119. case d:
  120. return $2(v2 + "Hours", 0);
  121. case u:
  122. return $2(v2 + "Minutes", 1);
  123. case s:
  124. return $2(v2 + "Seconds", 2);
  125. case i:
  126. return $2(v2 + "Milliseconds", 3);
  127. default:
  128. return this.clone();
  129. }
  130. }, m2.endOf = function(t2) {
  131. return this.startOf(t2, false);
  132. }, m2.$set = function(t2, e2) {
  133. var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
  134. if (o2 === c || o2 === h) {
  135. var y2 = this.clone().set(d, 1);
  136. y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
  137. } else
  138. l2 && this.$d[l2]($2);
  139. return this.init(), this;
  140. }, m2.set = function(t2, e2) {
  141. return this.clone().$set(t2, e2);
  142. }, m2.get = function(t2) {
  143. return this[b.p(t2)]();
  144. }, m2.add = function(r2, f2) {
  145. var d2, l2 = this;
  146. r2 = Number(r2);
  147. var $2 = b.p(f2), y2 = function(t2) {
  148. var e2 = O(l2);
  149. return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
  150. };
  151. if ($2 === c)
  152. return this.set(c, this.$M + r2);
  153. if ($2 === h)
  154. return this.set(h, this.$y + r2);
  155. if ($2 === a)
  156. return y2(1);
  157. if ($2 === o)
  158. return y2(7);
  159. var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
  160. return b.w(m3, this);
  161. }, m2.subtract = function(t2, e2) {
  162. return this.add(-1 * t2, e2);
  163. }, m2.format = function(t2) {
  164. var e2 = this, n2 = this.$locale();
  165. if (!this.isValid())
  166. return n2.invalidDate || l;
  167. var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
  168. return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
  169. }, d2 = function(t3) {
  170. return b.s(s2 % 12 || 12, t3, "0");
  171. }, $2 = f2 || function(t3, e3, n3) {
  172. var r3 = t3 < 12 ? "AM" : "PM";
  173. return n3 ? r3.toLowerCase() : r3;
  174. };
  175. return r2.replace(y, function(t3, r3) {
  176. return r3 || function(t4) {
  177. switch (t4) {
  178. case "YY":
  179. return String(e2.$y).slice(-2);
  180. case "YYYY":
  181. return b.s(e2.$y, 4, "0");
  182. case "M":
  183. return a2 + 1;
  184. case "MM":
  185. return b.s(a2 + 1, 2, "0");
  186. case "MMM":
  187. return h2(n2.monthsShort, a2, c2, 3);
  188. case "MMMM":
  189. return h2(c2, a2);
  190. case "D":
  191. return e2.$D;
  192. case "DD":
  193. return b.s(e2.$D, 2, "0");
  194. case "d":
  195. return String(e2.$W);
  196. case "dd":
  197. return h2(n2.weekdaysMin, e2.$W, o2, 2);
  198. case "ddd":
  199. return h2(n2.weekdaysShort, e2.$W, o2, 3);
  200. case "dddd":
  201. return o2[e2.$W];
  202. case "H":
  203. return String(s2);
  204. case "HH":
  205. return b.s(s2, 2, "0");
  206. case "h":
  207. return d2(1);
  208. case "hh":
  209. return d2(2);
  210. case "a":
  211. return $2(s2, u2, true);
  212. case "A":
  213. return $2(s2, u2, false);
  214. case "m":
  215. return String(u2);
  216. case "mm":
  217. return b.s(u2, 2, "0");
  218. case "s":
  219. return String(e2.$s);
  220. case "ss":
  221. return b.s(e2.$s, 2, "0");
  222. case "SSS":
  223. return b.s(e2.$ms, 3, "0");
  224. case "Z":
  225. return i2;
  226. }
  227. return null;
  228. }(t3) || i2.replace(":", "");
  229. });
  230. }, m2.utcOffset = function() {
  231. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  232. }, m2.diff = function(r2, d2, l2) {
  233. var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
  234. return b.m(y2, m3);
  235. };
  236. switch (M3) {
  237. case h:
  238. $2 = D2() / 12;
  239. break;
  240. case c:
  241. $2 = D2();
  242. break;
  243. case f:
  244. $2 = D2() / 3;
  245. break;
  246. case o:
  247. $2 = (g2 - v2) / 6048e5;
  248. break;
  249. case a:
  250. $2 = (g2 - v2) / 864e5;
  251. break;
  252. case u:
  253. $2 = g2 / n;
  254. break;
  255. case s:
  256. $2 = g2 / e;
  257. break;
  258. case i:
  259. $2 = g2 / t;
  260. break;
  261. default:
  262. $2 = g2;
  263. }
  264. return l2 ? $2 : b.a($2);
  265. }, m2.daysInMonth = function() {
  266. return this.endOf(c).$D;
  267. }, m2.$locale = function() {
  268. return D[this.$L];
  269. }, m2.locale = function(t2, e2) {
  270. if (!t2)
  271. return this.$L;
  272. var n2 = this.clone(), r2 = w(t2, e2, true);
  273. return r2 && (n2.$L = r2), n2;
  274. }, m2.clone = function() {
  275. return b.w(this.$d, this);
  276. }, m2.toDate = function() {
  277. return new Date(this.valueOf());
  278. }, m2.toJSON = function() {
  279. return this.isValid() ? this.toISOString() : null;
  280. }, m2.toISOString = function() {
  281. return this.$d.toISOString();
  282. }, m2.toString = function() {
  283. return this.$d.toUTCString();
  284. }, M2;
  285. }(), k = _.prototype;
  286. return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
  287. k[t2[1]] = function(e2) {
  288. return this.$g(e2, t2[0], t2[1]);
  289. };
  290. }), O.extend = function(t2, e2) {
  291. return t2.$i || (t2(e2, _, O), t2.$i = true), O;
  292. }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
  293. return O(1e3 * t2);
  294. }, O.en = D[g], O.Ls = D, O.p = {}, O;
  295. });
  296. }
  297. });
  298. export default require_dayjs_min();
  299. //# sourceMappingURL=dayjs.js.map