Skip to content
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

Fix timestamps set with Invalid Date in some cases #1796

merged 2 commits into from Mar 23, 2018


Copy link


The previous PR introduced a bug that led to the timestamp attributes sometimes being set with a Invalid Date value.

This only happened if a model with hasTimestamps set to true or an array was being fetched but the associated timestamp columns were omitted in the fetch call using the columns: [ ... ] option.

Strangely this also affected all calls of fetchPage causing null or missing values for rowCount and pageCount.

Proposed solution

This just checks if the relevant timestamp attributes return a truthy value before attempting to cast them to a Date object.

- This fixes the issue of timestamp attributes being set to Invalid
Date if the associated columns were ommitted in a fetch call.
@ricardograca ricardograca changed the title Rg fix timestamps Fix timestamps set with Invalid Date in some cases Mar 23, 2018
@ricardograca ricardograca merged commit fac27fd into master Mar 23, 2018
@ricardograca ricardograca deleted the rg-fix-timestamps branch March 23, 2018 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant