Improved parsing details in dateToW3CString to accept hours, minutes and seconds and different date formats

This commit is contained in:
alexandercerutti
2018-08-26 11:59:41 +02:00
parent e7c5a9a3bc
commit eeb925b2a5

View File

@@ -653,7 +653,7 @@ function dateToW3CString(date) {
return "";
}
let parsedDate = moment(date, ["MM-DD-YYYY"]).format();
let parsedDate = moment(date, ["MM-DD-YYYY hh:mm:ss", "YYYY-MM-DD hh:mm:ss", "DD-MM-YYYY hh:mm:ss"]).format();
if (parsedDate === "Invalid date") {
return undefined;