openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

DateRangeSelection not working for February 2020

Open KeKsBoTer opened this issue 5 years ago • 2 comments

OpenUI5 version:

1.85.0

Browser/version (+device/version):

MacOS Chrome/87.0.4280.88 (Official Build) (x86_64)

Any other tested browsers/devices(OK/FAIL):

Windows/Firefox 83.0 OK MacOS/Firefox 83.0 OK

Steps to reproduce the problem:

  1. Create a view with a sap.m.DateRangeSelection element
  2. Select February 2021 as month
  3. Select start and en date

What is the expected result?

The range is selected and returned as value in change listener

What happens instead?

An error is thrown:

Uncaught Error: Date parameter must be a JavaScript Date object: [null].
    fromLocalJSDate https://localhost:8443/resources/sap/ui/unified/calendar/CalendarDate.js?eval:314
    _updateSelection https://localhost:8443/resources/sap/ui/unified/calendar/Month.js?eval:2283
    _selectDay https://localhost:8443/resources/sap/ui/unified/calendar/Month.js?eval:1879
    _handleMousedown https://localhost:8443/resources/sap/ui/unified/calendar/Month.js?eval:1496
    _handleAfterFocus https://localhost:8443/resources/sap/ui/unified/calendar/Month.js?eval:2075
    fireEvent https://localhost:8443/resources/sap/ui/base/EventProvider.js?eval:247
    focusItem https://localhost:8443/resources/sap/ui/core/delegate/ItemNavigation.js?eval:596
    onmousedown https://localhost:8443/resources/sap/ui/core/delegate/ItemNavigation.js?eval:875
    each https://localhost:8443/resources/sap/ui/core/Element.js?eval:325
ui5loader.js line 1668 > eval:314:11

Any other information? (attach screenshot if possible)

The error occurs because the month starts with a monday and has exactly four weeks (28 days). This results in the fifths row being empty. This results in the "sapUiCalItem.sapUiCalDummy" dummy element being selected as Day in this line (aDomRefs = oRootDomRef.querySelectorAll(".sapUiCalItem");)

KeKsBoTer avatar Dec 14 '20 13:12 KeKsBoTer

Hello @KeKsBoTer ,

Thank you for sharing this finding. It successfully reproduced using sample: https://jsbin.com/momuyufeco/2/edit?html,output

I've created an internal incident 2080437818. The status of the issue will be updated here in GitHub.

Regards,

kineticjs avatar Dec 14 '20 17:12 kineticjs

Hi @kineticjs,

we are facing the same issue in version 1.84.3!

This is a major problem for us as we are currently in the midst of a customer project implementation and it doesn't work: Now it is February 2021 and they cannot select any time range that includes current data...

Could you please provide a hint when we can expect this to be fixed in 1.84.4 ??

Thank you and kind regards Pablo

PabloMizzle avatar Feb 04 '21 15:02 PabloMizzle