From db222383ae3c5b1643addc4814bf66c9a499d88d Mon Sep 17 00:00:00 2001 From: Artur Drobinskiy Date: Wed, 23 Feb 2022 14:50:14 +0700 Subject: [PATCH] fix DateOnly code --- .../Templates/ConvertToClass.liquid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NJsonSchema.CodeGeneration.TypeScript/Templates/ConvertToClass.liquid b/src/NJsonSchema.CodeGeneration.TypeScript/Templates/ConvertToClass.liquid index 04003f545..21ad6e1f7 100644 --- a/src/NJsonSchema.CodeGeneration.TypeScript/Templates/ConvertToClass.liquid +++ b/src/NJsonSchema.CodeGeneration.TypeScript/Templates/ConvertToClass.liquid @@ -52,7 +52,7 @@ if ({{ Value }}) { {% endif -%} {% else -%} {% if IsDate -%} -{{ Variable }} = {{ Value }} ? {{ StringToDateOnlyCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}{{ NullValue }}{% endif %}; +{{ Variable }} = {{ Value }} ? {{ StringToDateOnlyCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateOnlyCode }}({{ DefaultValue }}){% else %}{{ NullValue }}{% endif %}; {% elsif IsDateTime -%} {{ Variable }} = {{ Value }} ? {{ StringToDateCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}{{ NullValue }}{% endif %}; {% else -%} @@ -62,4 +62,4 @@ if ({{ Value }}) { {{ Variable }} = {{ Value }}; {% endif -%} {% endif -%} -{% endif -%} \ No newline at end of file +{% endif -%}