forked from loafle/openapi-generator-original
* updated the regex used in the String.replace for parseDate() to more precisely target ISO-8601 * added the replace function call to the ES6 mustache file
This commit is contained in:
parent
ef9e8b7181
commit
75b987104b
@ -576,7 +576,7 @@
|
|||||||
*/
|
*/
|
||||||
{{/emitJSDoc}} exports.parseDate = function(str) {
|
{{/emitJSDoc}} exports.parseDate = function(str) {
|
||||||
if (isNaN(str)) {
|
if (isNaN(str)) {
|
||||||
return new Date(str.replace(/T/i, ' '));
|
return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
|
||||||
}
|
}
|
||||||
return new Date(+str);
|
return new Date(+str);
|
||||||
};
|
};
|
||||||
|
@ -556,7 +556,7 @@ class ApiClient {
|
|||||||
*/{{/emitJSDoc}}
|
*/{{/emitJSDoc}}
|
||||||
static parseDate(str) {
|
static parseDate(str) {
|
||||||
if (isNaN(str)) {
|
if (isNaN(str)) {
|
||||||
return new Date(str);
|
return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
|
||||||
}
|
}
|
||||||
return new Date(+str);
|
return new Date(+str);
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ class ApiClient {
|
|||||||
*/
|
*/
|
||||||
static parseDate(str) {
|
static parseDate(str) {
|
||||||
if (isNaN(str)) {
|
if (isNaN(str)) {
|
||||||
return new Date(str);
|
return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
|
||||||
}
|
}
|
||||||
return new Date(+str);
|
return new Date(+str);
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ class ApiClient {
|
|||||||
*/
|
*/
|
||||||
static parseDate(str) {
|
static parseDate(str) {
|
||||||
if (isNaN(str)) {
|
if (isNaN(str)) {
|
||||||
return new Date(str);
|
return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
|
||||||
}
|
}
|
||||||
return new Date(+str);
|
return new Date(+str);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user