mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
mermaid ink image support
This commit is contained in:
15
src/services/utils/dateFormat.ts
Normal file
15
src/services/utils/dateFormat.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function formatHumanReadableDate(date: Date | string): string {
|
||||
const d = typeof date === "string" ? new Date(date) : date;
|
||||
if (isNaN(d.getTime())) return "Invalid date";
|
||||
|
||||
const options: Intl.DateTimeFormatOptions = {
|
||||
weekday: "short",
|
||||
// year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
};
|
||||
|
||||
return d.toLocaleString(undefined, options);
|
||||
}
|
||||
Reference in New Issue
Block a user