Skip to content

fix: PlanningCalendar startDateChange not fired when clicking empty cell#4442

Open
EdrilanBerisha wants to merge 1 commit into
UI5:masterfrom
EdrilanBerisha:fix/planning-calendar-startdatechange-oneMonth
Open

fix: PlanningCalendar startDateChange not fired when clicking empty cell#4442
EdrilanBerisha wants to merge 1 commit into
UI5:masterfrom
EdrilanBerisha:fix/planning-calendar-startdatechange-oneMonth

Conversation

@EdrilanBerisha
Copy link
Copy Markdown

PlanningCalendar startDateChange not fired when clicking empty cell outside of current calendar.

When the PlanningCalendar is in OneMonth view and the user clicks on an empty interval cell that belongs to the next month (e.g. clicking on March 2nd while viewing February), the calendar navigates to the next month but the 'startDateChange' event was NOT fired.

Root cause:
In the 'handleIntervalSelect' function, when an interval in a row timeline is clicked and the start date belongs to the next month, the code called:
this.shiftToDate(oStartDate);

The 'shiftToDate' method only fires 'startDateChange' when its second argument 'bOtherMonth' is truthy:
if (bOtherMonth) {
this.fireStartDateChange();
}

Since 'bOtherMonth' was not passed (undefined/false), 'startDateChange' was never fired.

Fix:
Pass 'true' as the second argument to 'shiftToDate' so that 'startDateChange' is fired after navigation:
this.shiftToDate(oStartDate, true);

This is consistent with how '_handleCalendarSelect' already handles the same scenario (line ~3355):
this.shiftToDate(oEvtSelectedStartCalendarDate.toLocalJSDate(), true);

Fixes: GitHub issue #4413

…ell outside current month

When the PlanningCalendar is in OneMonth view and the user clicks on an
empty interval cell that belongs to the next month (e.g. clicking on
March 2nd while viewing February), the calendar navigates to the next
month but the 'startDateChange' event was NOT fired.

Root cause:
In the 'handleIntervalSelect' function, when an interval in a row
timeline is clicked and the start date belongs to the next month, the
code called:
  this.shiftToDate(oStartDate);

The 'shiftToDate' method only fires 'startDateChange' when its second
argument 'bOtherMonth' is truthy:
  if (bOtherMonth) {
    this.fireStartDateChange();
  }

Since 'bOtherMonth' was not passed (undefined/falsy), 'startDateChange'
was never fired.

Fix:
Pass 'true' as the second argument to 'shiftToDate' so that
'startDateChange' is fired after navigation:
  this.shiftToDate(oStartDate, true);

This is consistent with how '_handleCalendarSelect' already handles the
same scenario (line ~3355):
  this.shiftToDate(oEvtSelectedStartCalendarDate.toLocalJSDate(), true);

Fixes: GitHub issue UI5#4413
@EdrilanBerisha
Copy link
Copy Markdown
Author

@stoyanovski

can you please review this PR please?

@stoyanovski stoyanovski requested a review from Todor-ads May 26, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant