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;