Sequelize 4 returns date strings not timestamps so don't shift #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of Sequelize 4 dateonly fields are returned as date strings not
dateTime strings. Therefore the formatting functionality here will
return incorrect values for dateonly fields in Sequelize 4 if the server
is in a timezone with a negative UTC shift.
Ex: I have 1990-10-02 stored in my DB. The formatting function will
shift that to 1990-10-01T16:00:00 if I am in PST. In the UI 01/10/1990
will be shown
sequelize/sequelize#4858
As a sidenote the existing shifting logic seems backwards to me but it's very possible that I'm missing something. Let's say I have a DATEONLY value of
1990-10-02
in my db. My understanding of sequelize 3 is that it will return1990-10-02T00:00:00z
. If I have a negative UTC offset it's still going to shift my date back to the wrong day. I didn't make a change here as I figure I might be missing something.Accompanying change coming in https://github.com/forestadmin/forest-express-sequelize