New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sequelize v6.12.0+ is throwing an Error when using a moment.js object in date fields #13816
Comments
Hello, just adjusted and created the fix in #13818, thanks for the issue. |
🎉 This issue has been resolved in version 7.0.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Could you please give it a try and see if it a try for you? |
```
Hi @sdepold, thanks for the fix but shouldn’t this change be included in v6 instead of v7? It’s a breaking bug/change that will affect anyone upgrading a minor version that’s using momentjs (my guess is it could be a significant number).
Just keep in mind that this bug can also silenty set dates to 0000-00-00 without throwing an error (the error is thrown only when selecting/searching).
Thanks
```
Correct. There is also a new v6 bugfix version.
… Am 28.12.2021 um 05:22 schrieb Cristián Meléndez ***@***.***>:
Hi @sdepold, thanks for the fix but shouldn’t this change be included in v6 instead of v7? It’s a breaking bug/change that will affect anyone upgrading a minor version that’s using momentjs (my guess is it could be a significant number).
Just keep in mind that this bug can also silenty set dates to 0000-00-00 without throwing an error (the error is thrown only when selecting/searching).
Thanks.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
🎉 This issue has been resolved in version 7.0.0-alpha2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
A bit late but just confirming that the fix is working properly. We are using v6.13.0. Thanks a lot! |
now 2022 .
|
here is my code
|
ah solved here https://stackoverflow.com/a/46390179/8122500 toDate() |
Bug Description
Sequelize is throwing an
Invalid value
error when using amoment.js
object inDATETIME
fields to do date comparisons. Additionally, when using a Moment object to set a date, the date value is set to0000-00-00 00:00:00
This 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 value
error is thrown, crashing the app.Additional context
mysql
as dialectEnvironment
Bug Report Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: