Skip to content

Scheduler — Add hiddenDays option to hide arbitrary days of the week#33188

Open
aleksei-semikozov wants to merge 43 commits intoDevExpress:26_1from
aleksei-semikozov:feature/scheduler-hidden-days-impl-26_1
Open

Scheduler — Add hiddenDays option to hide arbitrary days of the week#33188
aleksei-semikozov wants to merge 43 commits intoDevExpress:26_1from
aleksei-semikozov:feature/scheduler-hidden-days-impl-26_1

Conversation

@aleksei-semikozov
Copy link
Copy Markdown
Contributor

No description provided.

@sjbur sjbur closed this Apr 13, 2026
@sjbur sjbur reopened this Apr 13, 2026
nextDate: (date: Date) => Date,
): Date => {
let date = new Date(start);
while (isDateSkipped(date, skippedDays)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infinite loop risk: if skippedDays contains all 7 days (bypassing normalizeHiddenWeekDays), this loops forever. Add a safety counter:

while (isDateSkipped(date, skippedDays) && ++guard < 8)

or rewrite to for...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The risk is theoretical, because skippedDays can't have all days because of our validation, but still makes sense. I added if condition which checks additionally if the skippedDays is 7 and fixes the potential issue


protected incrementDate(date) {
date.setDate(date.getDate() + 1);
while ((this.option('skippedDays') ?? []).includes(date.getDay())) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same infinite loop risk — while loop skipping days has no max iterations guard.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"Thu 5",
"Fri 6",
"Sat 7",
"Mon 9",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot changed "Sat 7""Mon 9" in TimelineWorkWeek — is this intentional? Old snapshot had Mon-Sat (7 days), now skips Sat/Sun. Please confirm the new incrementDate logic correctly handles TimelineWorkWeek headers.

Copy link
Copy Markdown
Contributor

@sjbur sjbur Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended. This is bug not related with timezone. In the snapshot we saved a buggy state that no one noticed is buggy. In timelineWorkWeek we can't have weekend days. You can see the bug here: https://codepen.io/sjbur/pen/Kwgbqdr

Also attaching two screenshots: the first is original state with bug, second one is current implementation without bug.

Image Image

"Thu 5",
"Fri 6",
"Sat 7",
"Mon 9",
Copy link
Copy Markdown
Contributor

@sjbur sjbur Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended. This is bug not related with timezone. In the snapshot we saved a buggy state that no one noticed is buggy. In timelineWorkWeek we can't have weekend days. You can see the bug here: https://codepen.io/sjbur/pen/Kwgbqdr

Also attaching two screenshots: the first is original state with bug, second one is current implementation without bug.

Image Image

@sjbur sjbur marked this pull request as ready for review April 14, 2026 14:09
@sjbur sjbur requested a review from a team as a code owner April 14, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants