This commit is contained in:
10
utils/general.ts
Normal file
10
utils/general.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export const formatDate = (date: string) => {
|
||||
if (!date) return null;
|
||||
const [day, month, year] = date.split(".");
|
||||
const d = new Date(`${year}-${month}-${day}`);
|
||||
return d.toLocaleDateString("en-US", {
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user