openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.PlanningCalendar Change Period issue on Islamic

Open malkoto1 opened this issue 3 years ago • 9 comments

OpenUI5 version: 1.110.0

Browser/version (+device/version): All

When using the sap.m.PlanningCalendar with calendarType set to Islamic, on the built in weekly view, a problem with changing the shown period occurs.

Refer to the picture below as a starting point: image

  1. When clicking to go to right (the past) the calendar goes two weeks in the past: image

  2. After a click to the left (in the future) nothing happens and error is thrown. image

  • Second click changes the week

image

What is the expected result? Expectation is for the calendar to work normally

What happens instead?

  1. If button to go in the past is clicked -> the calendar goes two weeks in the past and not only one
  2. If button to go in the future is clicked -> two clicks are needed
  • First clicks throws error
  • Second click changes the period (with one week which is expected)

malkoto1 avatar Jan 30 '23 09:01 malkoto1

Could you please share a link to a minimal sample to reproduce the error?

boghyon avatar Feb 02 '23 16:02 boghyon

Hi There,

I am working on the sample.

Meanwhile, as it may take time, I am sure that this won't be hard to try an use a localised setup for testing.

malkoto1 avatar Feb 02 '23 16:02 malkoto1

Hi There,

Please find the bug example attached.

PlanningCalendarArabicWeekBUG.zip

malkoto1 avatar Feb 09 '23 12:02 malkoto1

@malkoto1 Thanks for the sample!

Based on that, here are the steps to reproduce the issue from the Demo Kit sample:

  1. Open https://sdk.openui5.org/nightly/resources/sap/ui/documentation/sdk/index.html?sap-ui-xx-sample-id=sap.m.sample.PlanningCalendar&sap-ui-xx-sample-lib=sap.m&sap-ui-xx-sample-origin=.&sap-ui-xx-dk-origin=https%3A%2F%2Fsdk.openui5.org&sap-ui-theme=sap_horizon&sap-ui-language=ar_AR&sap-ui-rtl=true&sap-ui-xx-componentPreload=off (From the sample "Planning Calendar - with legend and option to change the first day of week")
  2. Switch to the following PCalendar settings e.g. via the console:
    sap.ui.getCore().byId("__xmlview0--PC1")
      .setBuiltInViews(["Week"])
      .setPrimaryCalendarType("Islamic")
      .setFirstDayOfWeek(0);
    
  3. Click on the > button once.
  4. Click on the < button once.

We can see then the following error afterwards:

Uncaught Error: Date must be in visible date range; Element sap.ui.unified.calendar.DatesRow#__xmlview0--PC1-WeeksRow

  • at DatesRow.displayDate (DatesRow-dbg.js:186:10)
  • at PlanningCalendar._applyArrowsLogic (PlanningCalendar-dbg.js:981:8)
  • at PlanningCalendar._handlePressArrow (PlanningCalendar-dbg.js:953:8)
  • ...
  • at fnClass. (PlanningCalendarHeader-dbg.js:315:10)
  • ...
  • at fnClass.eval [as firePress] (ManagedObjectMetadata-dbg.js?eval:801:49)

We can also see the following warning after switching to the Islamic calendar (visible with logLevel >= WARNING):

No calendar customizations. -

The above error, however, occurs also without setPrimaryCalendarType("Islamic").

boghyon avatar Feb 09 '23 15:02 boghyon

Hello @malkoto1 , Thank you for sharing this finding. I've created an internal incident 2380032168. The status of the issue will be updated here in GitHub.

50gY avatar Feb 09 '23 15:02 50gY

Hello all,

Is there any progress on this item?

malkoto1 avatar Feb 22 '23 09:02 malkoto1

Hello @malkoto1 ,

We are working on the issue and will update as soon as we have a fix.

Best regards, Petya

petyabegovska avatar Feb 22 '23 13:02 petyabegovska

Hello @malkoto1,

I've made a fix. It will be available in version 1.115.0, which should release around mid June.

Best regards, Stefan

Lyserg-Diethel avatar May 29 '23 15:05 Lyserg-Diethel

Fixed with: cb577f8

Lyserg-Diethel avatar May 29 '23 15:05 Lyserg-Diethel