-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor logic for graying out timeslots (#345)
* Round down to closest half hour When graying out timeslots based on the current time index, the current time should be rounded down to the closest half hour. * Refactor current time idx calculation * Update endingOperatingHour to 6 pm in frontend * Fix the error in rounding up when OH start is exactly 10 am * Add test for round_idx_calculation * Gray out timeslots when user has an XL drop-in reservation * Write test for newly added helper function * Chose to not display past slots instead of graying out The graying out timeslots was a design choice we made earlier when our table was static in size. But with the addition of a dynamic table, this feature was relatively easy to implement. * Uncomment important code Some code was left commented out while playing around to implement the new features. This code just deleted SN156 from the table to prevent users from making reservations to the XL. * Add comments There is certain part of the code which is no longer needed to gray out past timeslots. However, I have just commented it out rather than deleting it if we need to revert back to graying out timeslots logic for any reason.
- Loading branch information
1 parent
1b9b0f6
commit 77ef254
Showing
3 changed files
with
75 additions
and
21 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
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