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

38 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 7990
// Function ID: 63244
2026-07-20 16:05:17 +00:00
// Name: formatExpirationLabel
2026-07-23 10:11:24 +00:00
// Dependencies: [3712, 1212, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 7990 (formatExpirationLabel)
2026-07-20 16:05:17 +00:00
function formatExpirationLabel(expiry) {
2026-07-23 10:11:24 +00:00
const tmp = importDefault(3712)();
2026-07-20 16:05:17 +00:00
if (expiry > tmp) {
const diffResult = expiry.diff(tmp, "days");
if (diffResult > 1) {
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
let obj = { days: diffResult };
2026-07-23 10:11:24 +00:00
return intl3.formatToPlainString(require(1212) /* getSystemLocale */.t.dex68a, obj);
2026-07-20 16:05:17 +00:00
} else {
const diffResult1 = expiry.diff(tmp, "hours");
if (diffResult1 > 1) {
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
obj = { hours: diffResult1 };
2026-07-23 10:11:24 +00:00
return intl2.formatToPlainString(require(1212) /* getSystemLocale */.t.BWqf0c, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
obj = { minutes: expiry.diff(tmp, "minutes") };
2026-07-23 10:11:24 +00:00
return intl.formatToPlainString(require(1212) /* 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 };