SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.23k forks source link

sap.m.PlanningCalendar Change Period issue on Islamic #3689

Closed malkoto1 closed 1 year ago

malkoto1 commented 1 year ago

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)
boghyon commented 1 year ago

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

malkoto1 commented 1 year ago

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 commented 1 year ago

Hi There,

Please find the bug example attached.

PlanningCalendarArabicWeekBUG.zip

boghyon commented 1 year ago

@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").

i556484 commented 1 year ago

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.

malkoto1 commented 1 year ago

Hello all,

Is there any progress on this item?

petyabegovska commented 1 year ago

Hello @malkoto1 ,

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

Best regards, Petya

Lyserg-Diethel commented 1 year ago

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 commented 1 year ago

Fixed with: cb577f8