Bug Description
Sequelize is throwing an Invalid value error when using a moment.js object in DATETIME fields to do date comparisons. Additionally, when using a Moment object to set a date, the date value is set to 0000-00-00 00:00:00
This is happening since v6.12.0.
User.findAll({
where: {
birthday: {
[Op.gte]: moment()
}
}
});
What do you expect to happen?
Moment objects should be accepted for date comparison, creation, etc. as usual.
What is actually happening?
An Invalid value error is thrown, crashing the app.
Invalid value Moment<2021-12-21T19:52:23+00:00>
Additional context
Environment
- Sequelize version: 6.12.0
- Node.js version: 16.13.0
Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
Bug Description
Sequelize is throwing an
Invalid valueerror when using amoment.jsobject inDATETIMEfields to do date comparisons. Additionally, when using a Moment object to set a date, the date value is set to0000-00-00 00:00:00This is happening since v6.12.0.
What do you expect to happen?
Moment objects should be accepted for date comparison, creation, etc. as usual.
What is actually happening?
An
Invalid valueerror is thrown, crashing the app.Additional context
mysqlas dialectEnvironment
Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?