use proper date formatting on form for expiry

This commit is contained in:
Harvey Tindall
2021-04-07 15:17:15 +01:00
parent 66b7df7cde
commit 871bc9f396
4 changed files with 12 additions and 8 deletions
+8 -6
View File
@@ -15,12 +15,14 @@ export function toDateString(date: Date): string {
hour: "2-digit",
minute: "2-digit"
};
if (t12.checked) {
args1["hour12"] = true;
args2["hour12"] = true;
} else if (t24.checked) {
args1["hour12"] = false;
args2["hour12"] = false;
if (t12 && t24) {
if (t12.checked) {
args1["hour12"] = true;
args2["hour12"] = true;
} else if (t24.checked) {
args1["hour12"] = false;
args2["hour12"] = false;
}
}
return date.toLocaleDateString(locale, args1) + " " + date.toLocaleString(locale, args2);
}