adding handling for epoch dates in javascript ApiClient mustache file (#6497) (#6504)

This commit is contained in:
Troy P
2020-08-04 08:55:38 -07:00
committed by GitHub
parent c1b53df345
commit 9f1d012d14
4 changed files with 20 additions and 8 deletions

View File

@@ -476,12 +476,15 @@ class ApiClient {
}
/**
* Parses an ISO-8601 string representation of a date value.
* Parses an ISO-8601 string representation or epoch representation of a date value.
* @param {String} str The date value as a string.
* @returns {Date} The parsed date object.
*/
static parseDate(str) {
return new Date(str);
if (isNaN(str)) {
return new Date(str);
}
return new Date(+str);
}
/**