Fixed date initialization from decoder

This commit is contained in:
Ivan Babkin 2019-05-20 13:16:19 +03:00
parent 59c2cb0ba0
commit 41fcf554fa
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@
{% macro initExpr(field) %}
{%- import _self as self -%}
{%- if field.type.type.baseTypeName == "DateTime" -%}
{%- set dateTimeInit = "ApiDateFormattingService.date(from: %s, format: .%s, parsedIn: nil)"|format(field.name, field.type.dateFormat) -%}
{%- set dateTimeInit = "ApiDateFormattingService.date(from: %s, format: .%s, parsedIn: nil)"|format(field.name, dateFormatToName(field.type.dateFormat)) -%}
{{ self.decodeThrowableField(field, dateTimeInit, 'init?(string:format:fromRegion:) returned nil') -}}
{%- elseif field.type.type.baseTypeName == "Color" -%}
{%- set colorInit = "UIColor(hexString: %s)"|format(field.name) -%}