Files
discord-decomp/modules/multi_account/StatusUtils.tsx
T
2026-11-01 12:12:55 +02:00

33 lines
1000 B
TypeScript

// Metro module 10257 (f10258).
import { intl } from "../../intl/index.native";
export function getStatusExpiryParts(a0) {
const date = new Date(Number(a0));
const date2 = new Date();
const r1 = date.getFullYear() === date2.getFullYear() && date.getMonth() === date2.getMonth() && date.getDate() === date2.getDate();
const date3 = new Date();
date3.setDate(date3.getDate() + 1);
const r2 = date.getFullYear() === date3.getFullYear() && date.getMonth() === date3.getMonth() && date.getDate() === date3.getDate();
const timeString = intl.data.formatTime(date, {
format: "short"
});
return r1 ? {
kind: "today",
dateString: intl.data.formatRelativeTime(0, "day", {
numeric: "auto"
}),
timeString
} : r2 ? {
kind: "tomorrow",
dateString: intl.data.formatRelativeTime(1, "day", {
numeric: "auto"
}),
timeString
} : {
kind: "date",
dateString: intl.data.formatDate(date, {
dateStyle: "short"
}),
timeString
};
}