diff --git a/src/utils/formatterUtils.ts b/src/utils/formatterUtils.ts new file mode 100644 index 00000000..52658075 --- /dev/null +++ b/src/utils/formatterUtils.ts @@ -0,0 +1,18 @@ +export function formatDateTime(date: Date): string { + + const daysOfWeek: Array = [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ] + + const day = date.getDate().toString(); + const monthIndex = date.getMonth().toString(); + const year = date.getFullYear().toString(); + const dayOfWeek = daysOfWeek[date.getDay()]; + return `${day}-${monthIndex}-${year} (${dayOfWeek})`; +}