-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- If startFromMonday is false, startIndex needs to be assigned firstWeekDay modulo 7 (because otherwise if the first week day is Sunday, firstWeekDay is 7 from isoWeekday() and the index variable from guideArray is never >= 7, and so the first row just consists of 7 EmptyDay elements). - Also split guideArray into dayArray and weekArray, since it is used for both days and weeks, but there can't be 7 rows of weeks in a calendar view for any month. - Renamed the generateColumns() function to generateDatesForWeek() to better explain what it is doing. - Removed the unnecessary intermediate "column" constant (it wasn't really being used). - Renamed the 2 current value "index" variables in the map functions to better describe what they are being used for. - Added some blank lines and spaces for better readability. The snapshots in the tests were updated to remove the extra (empty) row that was being added due to the code previously looping over 7 weeks in every month, which has now been changed to 6 weeks.
- Loading branch information
1 parent
59bc124
commit c309046
Showing
2 changed files
with
21 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters