Files
Arkie-Library-Frontend/src/components/messageStream/utils/formatTime.ts
TerryM d7e2e56cde ui: home carousel height lock + bubble polish
- Home: lock category carousel height to the tallest page so the
  Official Recommendations section below does not jump up when
  swiping to a page with fewer categories.
- CollapsibleText: raise default threshold to 25 lines and tighten
  the spacing between the expand-all button and the timestamp
  (drop the fixed h-8 and use mt-1 instead of mt-1.5).
- formatTime: always render dates as yyyy/m/d HH:mm regardless of
  locale, matching the requested timestamp format.
2026-05-30 00:43:54 +08:00

18 lines
458 B
TypeScript

function pad2(n: number): string {
return String(n).padStart(2, "0");
}
function formatDate(iso: string): string {
const d = new Date(iso);
return `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()}`;
}
export function formatTime(iso: string): string {
const d = new Date(iso);
return `${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
}
export function formatDateTime(iso: string): string {
return `${formatDate(iso)} ${formatTime(iso)}`;
}