Replies: 1 comment 7 replies
-
The problem here is that you don't set the You can do this instead: @Property({ type: 'date', columnType: 'timestamp(3)', nullable: true })
createdAt: Date | null = null |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I have some entity properties declared as follows:
I need this to be able to have
null
values from factories and be able to compare those with entities fetched from the database.I get an error when trying to assign a date with
orm.em.assign(foo, { createdAt: new Date() });
, althoughfoo.createdAt = new Date();
works.(see below to reproduce with a full example)
Stack trace
It seems that the type inferred from the EntityValidator is wrong (string instead of date).
To Reproduce
Steps to reproduce the behavior:
orm.em.assign
with a date like so:Expected behavior
orm.em.assign
to work the same as setting the property value directly.Versions
Beta Was this translation helpful? Give feedback.
All reactions