mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Improved parsing details in dateToW3CString to accept hours, minutes and seconds and different date formats
This commit is contained in:
2
index.js
2
index.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user