decord/source/modules/notification_center/getTimestampString.tsx

67 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 7149
// Function ID: 7150
2026-07-20 16:05:17 +00:00
// Name: getDurationString
2026-08-12 06:57:52 +00:00
// Dependencies: [1236, 3943, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getAbbreviatedFormatter, getFullFormatter
2026-08-13 07:00:46 +00:00
// Module 7149 (getDurationString)
2026-07-20 16:05:17 +00:00
function getDurationString(seconds) {
seconds = seconds.seconds;
const formatter = seconds.getFormatter();
if (seconds < 60) {
2026-07-29 08:29:29 +00:00
const intl6 = require(1236) /* getSystemLocale */.intl;
let formatToPlainStringResult = intl6.formatToPlainString(formatter.minutes, { minutes: 1 });
2026-07-20 16:05:17 +00:00
} else if (seconds < 3600) {
2026-07-29 08:29:29 +00:00
const intl5 = require(1236) /* getSystemLocale */.intl;
let obj = { minutes: null };
2026-07-20 16:05:17 +00:00
const _Math5 = Math;
2026-07-29 08:29:29 +00:00
obj[0] = Math.floor(seconds / 60);
2026-07-20 16:05:17 +00:00
formatToPlainStringResult = intl5.formatToPlainString(formatter.minutes, obj);
} else if (seconds < 86400) {
2026-07-29 08:29:29 +00:00
const intl4 = require(1236) /* getSystemLocale */.intl;
obj = { hours: null };
2026-07-20 16:05:17 +00:00
const _Math4 = Math;
2026-07-29 08:29:29 +00:00
obj[0] = Math.floor(seconds / 3600);
formatToPlainStringResult = intl4.formatToPlainString(formatter.hours, obj);
2026-07-23 10:11:24 +00:00
} else if (seconds < c3) {
2026-07-29 08:29:29 +00:00
const intl3 = require(1236) /* getSystemLocale */.intl;
const obj1 = { days: null };
2026-07-20 16:05:17 +00:00
const _Math3 = Math;
2026-07-29 08:29:29 +00:00
obj1[0] = Math.floor(seconds / 86400);
formatToPlainStringResult = intl3.formatToPlainString(formatter.days, obj1);
2026-07-23 10:11:24 +00:00
} else if (seconds < c4) {
2026-07-29 08:29:29 +00:00
const intl2 = require(1236) /* getSystemLocale */.intl;
const obj2 = { months: null };
2026-07-20 16:05:17 +00:00
const _Math2 = Math;
2026-07-29 08:29:29 +00:00
obj2[0] = Math.floor(seconds / tmp20);
formatToPlainStringResult = intl2.formatToPlainString(formatter.months, obj2);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
obj = { years: null };
2026-07-20 16:05:17 +00:00
const _Math = Math;
2026-07-29 08:29:29 +00:00
obj[0] = Math.floor(seconds / tmp21);
2026-07-20 16:05:17 +00:00
formatToPlainStringResult = intl.formatToPlainString(formatter.years, obj);
}
return formatToPlainStringResult;
}
2026-07-23 10:11:24 +00:00
let c3 = 2592000;
let c4 = 31104000;
const result = require("set").fileFinishedImporting("modules/notification_center/getTimestampString.tsx");
2026-07-20 16:05:17 +00:00
export default function getTimestampString(arg0) {
let getFormatter;
let since;
2026-07-29 08:29:29 +00:00
const obj = { seconds: null, getFormatter: null };
2026-07-20 16:05:17 +00:00
({ since, getFormatter } = arg0);
2026-08-12 06:57:52 +00:00
obj[0] = importDefault(3943)().diff(importDefault(3943)(since), "s");
2026-07-29 08:29:29 +00:00
obj[1] = getFormatter;
2026-07-20 16:05:17 +00:00
return getDurationString(obj);
};
export const getAbbreviatedFormatter = function getAbbreviatedFormatter() {
2026-07-29 08:29:29 +00:00
return { minutes: require(1236) /* getSystemLocale */.t["XIGt+W"], hours: require(1236) /* getSystemLocale */.t.rhY1Rs, days: require(1236) /* getSystemLocale */.t.GBLpQ8, months: require(1236) /* getSystemLocale */.t.XzBNbS, years: require(1236) /* getSystemLocale */.t.I1E8p6 };
2026-07-20 16:05:17 +00:00
};
export const getFullFormatter = function getFullFormatter() {
2026-07-29 08:29:29 +00:00
return { minutes: require(1236) /* getSystemLocale */.t["GqQ/Y9"], hours: require(1236) /* getSystemLocale */.t.c5zfWZ, days: require(1236) /* getSystemLocale */.t.amjnaI, months: require(1236) /* getSystemLocale */.t.SoON3V, years: require(1236) /* getSystemLocale */.t["12B3Re"] };
2026-07-20 16:05:17 +00:00
};
export { getDurationString };