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

Stop incorrect date initialisation at month end #1691

Merged
merged 1 commit into from Aug 29, 2014
Merged

Stop incorrect date initialisation at month end #1691

merged 1 commit into from Aug 29, 2014

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Aug 29, 2014

Bug manifested as a failing test on Aug 29, the tests use February as an example. The JavaScript was creating a date, using today, then going through and setting each of the properties, eg year, month etc. On August 29, setting the month to February would try and create a date “February 29” (non-leap year) which is not a valid date, so JavaScript switches the month to March.

  • Avoid bug by creating variables from each date input then creating a date all at once

screen shot 2014-08-29 at 12 30 08

Bug manifested as a failing test on Aug 29, the tests use February as
an example. The JavaScript was creating a date, using today, then going
through and setting each of the properties, eg year, month etc. On
August 29, setting the month to February would try and create a date
“February 29” (non-leap year) which is not a valid date, so JavaScript
switches to March 1st.

* Avoid bug by creating variables from each date input then creating a
date all at once
@rboulton
Copy link
Contributor

@rboulton rboulton commented Aug 29, 2014

Code looks good to me, and this makes total sense as an explanation. Thanks.

alext added a commit that referenced this pull request Aug 29, 2014
Stop incorrect date initialisation at month end
@alext alext merged commit ec83c2e into master Aug 29, 2014
1 check passed
1 check passed
default Build #3983 succeeded on Jenkins
Details
@alext alext deleted the fix-stats-js-date branch Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.