decord/source/1998_formatDistance.js

31 lines
1.7 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 1998
// Function ID: 1999
2026-07-29 08:29:29 +00:00
// Name: formatDistance
2026-07-23 10:11:24 +00:00
// Dependencies: []
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 1998 (formatDistance)
2026-07-23 10:11:24 +00:00
let closure_0 = { lessThanXSeconds: { one: "less than a second", other: "less than {{count}} seconds" }, xSeconds: { one: "1 second", other: "{{count}} seconds" }, halfAMinute: "half a minute", lessThanXMinutes: { one: "less than a minute", other: "less than {{count}} minutes" }, xMinutes: { one: "1 minute", other: "{{count}} minutes" }, aboutXHours: { one: "about 1 hour", other: "about {{count}} hours" }, xHours: { one: "1 hour", other: "{{count}} hours" }, xDays: { one: "1 day", other: "{{count}} days" }, aboutXWeeks: { one: "about 1 week", other: "about {{count}} weeks" }, xWeeks: { one: "1 week", other: "{{count}} weeks" }, aboutXMonths: { one: "about 1 month", other: "about {{count}} months" }, xMonths: { one: "1 month", other: "{{count}} months" }, aboutXYears: { one: "about 1 year", other: "about {{count}} years" }, xYears: { one: "1 year", other: "{{count}} years" }, overXYears: { one: "over 1 year", other: "over {{count}} years" }, almostXYears: { one: "almost 1 year", other: "almost {{count}} years" } };
export default function formatDistance(arg0, arg1, addSuffix) {
2026-08-04 21:03:28 +00:00
if (typeof table[arg0] === "string") {
2026-07-29 08:29:29 +00:00
let tmp5 = tmp;
2026-07-23 10:11:24 +00:00
if (null != addSuffix) {
2026-07-29 08:29:29 +00:00
tmp5 = tmp;
2026-07-23 10:11:24 +00:00
if (addSuffix.addSuffix) {
if (!addSuffix.comparison) {
let text = `${tmp} ago`;
}
text = `in ${tmp}`;
}
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-23 10:11:24 +00:00
} else if (1 === arg1) {
let one = tmp.one;
} else {
one = tmp.other.replace("{{count}}", arg1.toString());
const str = tmp.other;
}
};
export default exports.default;