Skip to content

Commit b0854a1

Browse files
committed
Allow a Date to be direclty passed to the typescript constructor
1 parent 52a1694 commit b0854a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Tool/Tool-typescript.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ end
202202
str *= indent * "}\n"
203203
elseif get_typescript_type(f) == "Date"
204204
str *= indent * "if (_json['$field_name'] != null) {\n"
205-
str *= indent * " " * "if (_json['refTime'] instanceof Date) {"
205+
str *= indent * " " * "if (_json['$field_name'] instanceof Date) {\n"
206206
str *= indent * " " * " " * "this.$field_name = _json['$field_name'];\n"
207-
str *= indent * " " * "} else {"
207+
str *= indent * " " * "} else {\n"
208208
str *= indent * " " * " " * "this.$field_name = new Date(_json['$field_name']);\n"
209-
str *= indent * " " * "}"
209+
str *= indent * " " * "}\n"
210210
str *= indent * "}\n"
211211
else
212212
str *= indent * "this.$field_name = _json['$field_name'];\n"

0 commit comments

Comments
 (0)