decord/source/lib/intlFormatDate.tsx

71 lines
1.9 KiB
TypeScript
Raw Normal View History

// Module ID: 4325
// Function ID: 4326
// Name: intlFormatDate
// Dependencies: [2026, 4322, 1115, 2]
2026-07-20 16:05:17 +00:00
// Exports: makeFormatter
// Module 4325 (intlFormatDate)
import LocaleStore from "LocaleStore" /* 2026 */;
2026-07-23 10:11:24 +00:00
const require = fn;
2026-07-20 16:05:17 +00:00
function makeIntlFormatter(locale, arg1) {
2026-07-29 08:29:29 +00:00
try {
const _Intl = Intl;
return Intl.DateTimeFormat(locale, arg1).format;
} catch (err) {
const _Intl2 = Intl;
return Intl.DateTimeFormat(undefined, tmp).format;
}
2026-07-20 16:05:17 +00:00
}
const size = fn(2);
const result = size.fileFinishedImporting("lib/intlFormatDate.tsx");
2026-07-20 16:05:17 +00:00
export const makeFormatter = function makeFormatter(arg0) {
locale = LocaleStore.locale;
2026-07-23 10:11:24 +00:00
let tmp = (function tryMakeNativeFormatter(locale, arg1) {
closure_0 = locale;
closure_1 = arg1;
if (null == closure_0(closure_1[1]).makeFormatter) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-07-29 08:29:29 +00:00
try {
let tmp4 = null != locale;
if (tmp4) {
const str2 = tmp2(tmp3[2]).systemLocale;
let first;
if (str2 != null) {
first = str2.split("-")[0];
}
tmp4 = locale.split("-")[0] === first;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (locale !== tmp2(tmp3[2]).initialLocale) {
const tmp7 = locale;
}
const formatter = tmp2(tmp3[1]).makeFormatter(tmp7, arg1);
if (null == formatter) {
return null;
} else {
closure_3 = null;
2026-07-29 08:29:29 +00:00
return (arg0) => {
try {
return formatter(arg0);
} catch (err) {
if (null == closure_3) {
closure_3 = makeIntlFormatter(closure_0, closure_1);
2026-07-29 08:29:29 +00:00
}
return closure_3(tmp);
2026-07-29 08:29:29 +00:00
}
};
}
const tmp2Result = tmp2(tmp3[1]);
} catch (err) {
return tmp;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
})(locale, arg0);
2026-07-20 16:05:17 +00:00
if (null == tmp) {
tmp = makeIntlFormatter(locale, arg0);
}
return tmp;
};