From b97fb00ea4d9784924be06f60201c2f5599c6f6a Mon Sep 17 00:00:00 2001 From: Elena Bobkova Date: Mon, 22 Jul 2019 13:26:15 +0300 Subject: [PATCH] date format condition added --- KotlinServer/blocks/class/constructor-fields-info.twig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/KotlinServer/blocks/class/constructor-fields-info.twig b/KotlinServer/blocks/class/constructor-fields-info.twig index 9a8df57..9ba9803 100644 --- a/KotlinServer/blocks/class/constructor-fields-info.twig +++ b/KotlinServer/blocks/class/constructor-fields-info.twig @@ -4,6 +4,9 @@ {%- if field.type.type.baseTypeName == "DateTime" %} @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "{{ utils.getDateFormat(field) }}", timezone = "utc") {%- endif %} + {%- if field.type.type.baseTypeName == "Date" %} + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "{{ utils.getDateFormat(field) }}") + {%- endif %} {%- if field.nullable %} @JsonInclude(JsonInclude.Include.ALWAYS) {%- elseif field.optional %}