Files
discord-decomp/sources/modules/multi_account/StatusUtils.tsx
T
2026-07-28 01:06:53 +03:00

64 lines
2.9 KiB
TypeScript

/* Metro module 10918; source: modules/multi_account/StatusUtils.tsx; dependencies: [1244, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
function _fun83666(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11104:6, offset: 0x01f23180, size: 107 bytes, params: 8, frame: 18
const env0_0 = require;
const isSameDate = function(a0, a1) {
var r0;
var value = a0.getFullYear();
value = value === a1.getFullYear();
if (value) {
value = a0.getMonth();
value = value === a1.getMonth();
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = a0.getDate();
value = value === a1.getDate();
r0 = value;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/multi_account/StatusUtils.tsx');
exports.getStatusExpiryParts = getStatusExpiryParts;
function getStatusExpiryParts(a0) { // fn#83668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11104:308, offset: 0x01f23241, size: 430 bytes, params: 2, frame: 22
let Date = global.Date;
const Number = global.Number;
let date = new Date(Number(a0));
const isSameDateBinding = isSameDate;
Date = global.Date;
const value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
const isSameDate2 = isSameDateBinding(date, date instanceof Object ? date : value4);
Date = global.Date;
date = new Date();
date.setDate(date.getDate() + 1);
const isSameDate3 = isSameDateBinding(date, date);
const intl = (IndexNativeModule).intl;
const value9 = intl.data.formatTime(date, {format: 'short'});
object = {};
if (isSameDate2) {
object.kind = 'today';
object.dateString = intl.data.formatRelativeTime(0, 'day', {numeric: 'auto'});
object.timeString = value9;
} else if (isSameDate3) {
object.kind = 'tomorrow';
object.dateString = intl.data.formatRelativeTime(1, 'day', {numeric: 'auto'});
object.timeString = value9;
} else {
object.kind = 'date';
object.dateString = intl.data.formatDate(date, {dateStyle: 'short'});
object.timeString = value9;
}
return object;
}
}
global.__d(_fun83666, 10918, [1244, 2]) /* metro module 10918, dependencies: [1244, 2] */;