mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
adjusting dates to be human friendly
This commit is contained in:
@@ -42,7 +42,14 @@ const parseDateOrThrow = (value: string, label: string): string => {
|
||||
if (isNaN(date.getTime())) {
|
||||
throw new Error(`Error with ${label}: ${value}`);
|
||||
}
|
||||
return date.toISOString();
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0"); // Months are zero-based
|
||||
const year = date.getFullYear();
|
||||
const hours = String(date.getHours()).padStart(2, "0");
|
||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||
|
||||
return `${day}/${month}/${year} ${hours}:${minutes}:${seconds}`;
|
||||
};
|
||||
|
||||
const parseDateOrNull = (value: string): string | undefined => {
|
||||
|
||||
Reference in New Issue
Block a user