dayjs_plugin_relativeTime.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import {
  2. __commonJS
  3. } from "./chunk-UQGIA5KH.js";
  4. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/dayjs/plugin/relativeTime.js
  5. var require_relativeTime = __commonJS({
  6. "../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/dayjs/plugin/relativeTime.js"(exports, module) {
  7. !function(r, e) {
  8. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
  9. }(exports, function() {
  10. "use strict";
  11. return function(r, e, t) {
  12. r = r || {};
  13. var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
  14. function i(r2, e2, t2, o2) {
  15. return n.fromToBase(r2, e2, t2, o2);
  16. }
  17. t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
  18. for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
  19. var y = h[c];
  20. y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
  21. var p = (r.rounding || Math.round)(Math.abs(f));
  22. if (s = f > 0, p <= y.r || !y.r) {
  23. p <= 1 && c > 0 && (y = h[c - 1]);
  24. var v = l[y.l];
  25. u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
  26. break;
  27. }
  28. }
  29. if (n2)
  30. return a;
  31. var M = s ? l.future : l.past;
  32. return "function" == typeof M ? M(a) : M.replace("%s", a);
  33. }, n.to = function(r2, e2) {
  34. return i(r2, e2, this, true);
  35. }, n.from = function(r2, e2) {
  36. return i(r2, e2, this);
  37. };
  38. var d = function(r2) {
  39. return r2.$u ? t.utc() : t();
  40. };
  41. n.toNow = function(r2) {
  42. return this.to(d(this), r2);
  43. }, n.fromNow = function(r2) {
  44. return this.from(d(this), r2);
  45. };
  46. };
  47. });
  48. }
  49. });
  50. export default require_relativeTime();
  51. //# sourceMappingURL=dayjs_plugin_relativeTime.js.map