Fixed date initialization from decoder
This commit is contained in:
parent
59c2cb0ba0
commit
41fcf554fa
|
|
@ -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) -%}
|
||||
|
|
|
|||
Loading…
Reference in New Issue