From ae6c69208142c503531d3d5972793d9a63a3cbe8 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Fri, 10 Aug 2018 16:33:17 -0400 Subject: [PATCH] Fixed date formatting in typescript node client --- .../src/main/resources/typescript-node/models.mustache | 2 +- samples/client/petstore/typescript-node/default/model/models.ts | 2 +- samples/client/petstore/typescript-node/npm/model/models.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache index 279340121611..b4d7d78dfea7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache @@ -97,7 +97,7 @@ export class ObjectSerializer { } return transformedData; } else if (type === "Date") { - return data.toString(); + return data.toISOString(); } else { if (enumsMap[type]) { return data; diff --git a/samples/client/petstore/typescript-node/default/model/models.ts b/samples/client/petstore/typescript-node/default/model/models.ts index 8ed47b194d73..7b0dc89cbf78 100644 --- a/samples/client/petstore/typescript-node/default/model/models.ts +++ b/samples/client/petstore/typescript-node/default/model/models.ts @@ -91,7 +91,7 @@ export class ObjectSerializer { } return transformedData; } else if (type === "Date") { - return data.toString(); + return data.toISOString(); } else { if (enumsMap[type]) { return data; diff --git a/samples/client/petstore/typescript-node/npm/model/models.ts b/samples/client/petstore/typescript-node/npm/model/models.ts index 8ed47b194d73..7b0dc89cbf78 100644 --- a/samples/client/petstore/typescript-node/npm/model/models.ts +++ b/samples/client/petstore/typescript-node/npm/model/models.ts @@ -91,7 +91,7 @@ export class ObjectSerializer { } return transformedData; } else if (type === "Date") { - return data.toString(); + return data.toISOString(); } else { if (enumsMap[type]) { return data;