Repository navigation
fix(gantt): keep exact dates when dragging or clicking bars - #8570
Merged
Merged
Conversation
frappe-gantt converts the bar position back to dates in whole units, truncating fractions. In the month view this snapped dates to the turn of the month, and bars shorter than a month ended one second before they started. The week and day views lost the time of day or minutes. The conversion also ran on any mouse movement while a bar was pressed, so just clicking a bar to open the card changed its dates. Take the card dates from the store when a drag starts and shift them by the dragged distance instead. Full days are added on the calendar so the time of day is kept across DST changes. Clicking a bar without moving it no longer saves anything. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
benjaminfrueh
approved these changes
Oct 20, 2026
This was referenced Oct 20, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
frappe-gantt converts the bar position back to dates in whole units, truncating fractions. In the month view this snapped dates to the turn of the month, and bars shorter than a month ended one second before they started. The week and day views lost the time of day or minutes. The conversion also ran on any mouse movement while a bar was pressed, so just clicking a bar to open the card changed its dates.
Take the card dates from the store when a drag starts and shift them by the dragged distance instead. Full days are added on the calendar so the time of day is kept across DST changes. Clicking a bar without moving it no longer saves anything.
Assisted-by: ClaudeCode:claude-opus-5-5
How to test manually
Use dates near today with non-zero minutes. That makes the rounding easy to see, and the Gantt view hides cards whose due date is more than a year in the past.
Checklist
馃 AI (if applicable)