Anchor of year sometimes marks correct answer as incorrect #1
Labels
No Label
bug
code-quality
documentation
duplicate
enhancement
feature
flair
invalid
on-hold
release
tooling
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tools/doomsday#1
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The year anchor weekday input sometimes marks the correct answer as incorrect. Forcing the random number generator to reproduce dates for which this happens does not seem to reproduce the bug. This bug does not occur with the other input fields.
The bug just reoccurred. Below is the entirety of the console log since the page was loaded until the date on which the bug occurred.
Running
new DoomsdayDate(new Date("1140-03-31")).getYearAnchorString()
in the console returns"Saturday"
even though the correct answer would be"Thursday"
.It appears that the original issue description was incorrect, because the bug is reproducible for dates with which this occurs. The bug occurs in the
#getYearAnchorString
method when the day of the week for which the doomsday should be calculated is31
. TheDate#setMonth
method will set the month to April, but because April doesn't have 31 days the date is set to the first of May instead. When the day is then set to the 4th, the resulting date is the 4th of May instead of the 4th of April.Switching around the order in which the day and month are set should resolve the issue.
To help in resolving future bugs, the debug output in the console will be retained.