This commit is contained in:
2026-05-11 16:24:14 +07:00
commit 6a48d6351c
313 changed files with 41936 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
/**
* Format a date to `20 March 2025` style.
*
* Accepts:
* - ISO string: "2025-03-20T07:59:53.219Z"
* - "2025-03-20" or other Dateparsable strings
* - Date instance
*/
export function formatLongDate(input: string | Date): string {
if (!input) return "";
const date = input instanceof Date ? input : new Date(input);
if (Number.isNaN(date.getTime())) return "";
return date.toLocaleDateString("en-GB", {
day: "numeric",
month: "long",
year: "numeric",
});
}