decord/source/modules/polls/chat/useFormattedExpirationLabel.tsx

41 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 7999
// Function ID: 8000
2026-07-20 16:05:17 +00:00
// Name: formatExpirationLabel
2026-07-29 08:29:29 +00:00
// Dependencies: [3771, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
// Module 7999 (formatExpirationLabel)
2026-07-20 16:05:17 +00:00
function formatExpirationLabel(expiry) {
2026-07-29 08:29:29 +00:00
const tmp2 = importDefault(3771)();
if (expiry > tmp2) {
const diffResult = expiry.diff(tmp2, "days");
2026-07-20 16:05:17 +00:00
if (diffResult > 1) {
2026-07-29 08:29:29 +00:00
const intl3 = require(1236) /* getSystemLocale */.intl;
let obj = { days: null };
obj[0] = diffResult;
return intl3.formatToPlainString(require(1236) /* getSystemLocale */.t.dex68a, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const diffResult1 = expiry.diff(tmp2, "hours");
2026-07-20 16:05:17 +00:00
if (diffResult1 > 1) {
2026-07-29 08:29:29 +00:00
const intl2 = require(1236) /* getSystemLocale */.intl;
obj = { hours: null };
obj[0] = diffResult1;
return intl2.formatToPlainString(require(1236) /* getSystemLocale */.t.BWqf0c, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
obj = { minutes: null };
obj[0] = expiry.diff(tmp2, "minutes");
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t["3SLXAz"], obj);
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/polls/chat/useFormattedExpirationLabel.tsx");
2026-07-20 16:05:17 +00:00
export default function useFormattedExpirationLabel(expiry) {
if (null != expiry) {
return formatExpirationLabel(expiry);
}
};
export { formatExpirationLabel };