Skip to content

Scheduler — Provide the SnapToCellsMode option — change 'auto' mode logic#33119

Merged
sjbur merged 2 commits into
DevExpress:26_1from
sjbur:issue-3833_26_1
Apr 2, 2026
Merged

Scheduler — Provide the SnapToCellsMode option — change 'auto' mode logic#33119
sjbur merged 2 commits into
DevExpress:26_1from
sjbur:issue-3833_26_1

Conversation

@sjbur
Copy link
Copy Markdown
Contributor

@sjbur sjbur commented Apr 1, 2026

No description provided.

@sjbur sjbur self-assigned this Apr 1, 2026
@sjbur sjbur added the 26_1 label Apr 1, 2026
@sjbur sjbur marked this pull request as ready for review April 1, 2026 13:47
@sjbur sjbur requested a review from a team as a code owner April 1, 2026 13:47
const cellDuration = startCell.max - startCell.min;
const appointmentDuration = entity.endDateUTC - entity.startDateUTC;
const isLessThanTwoCells = cellDuration > 0 && appointmentDuration / cellDuration < 2;

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.

minor: snapStart and snapEnd are always identical now. Can simplify to one boolean:

const shouldSnap = mode === 'always' || isLessThanTwoCells;
return { snapStart: shouldSnap, snapEnd: shouldSnap };

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.

Nice suggestion. Applied

@sjbur sjbur merged commit 5e2409a into DevExpress:26_1 Apr 2, 2026
106 of 107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants