Skip to content

Commit 0023232

Browse files
committed
bugfix for Date constructor
1 parent bd5dc69 commit 0023232

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tool/Tool-typescript.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ end
192192
str *= indent * " " * "this.$field_name.push(Number($elt_type[e]));\n"
193193
str *= indent * " " * "}\n"
194194
str *= indent * "}\n"
195+
elseif get_typescript_type(f) == "Date"
196+
str *= indent * "if (_json['$field_name'] != null) {\n"
197+
str *= indent * " " * "this.$field_name = new Date(_json['$field_name']);\n"
198+
str *= indent * "}\n"
195199
else
196200
str *= indent * "this.$field_name = _json['$field_name'];\n"
197201
end

0 commit comments

Comments
 (0)