You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an edge case, but when the config's calendarType is set to Islamic or Buddhist, and the date picker/calendar component has primary-calendar-type set to Gregorian, the week numbers that are displayed are wrong. Please see:
This is because in the calculation it will get the oJanFirst from a new UniversalDate object, but this object will be an instance of the config calendar, so when it does the calculation on line 27, the result is way off. calculateWeekNumber.ts#L19
(Note: This is not reproducible on openUI5, so I presume they have different logic to calculate the week number.)
Affected Component
Day Picker
Expected Behaviour
They week number will be the correct value per that calendar type being used for the component. (Note, week numbers are only used for Gregorian calendar)
…lation (#9043)
Previously when a calendarType was being set to Islamic or Buddhist in the document configuration, and a primary-calendar-type="Gregorian" on a date component level where week numbering is present, for example <ui5-date-picker primary-calendar-type="Gregorian">, <ui5-calendar primary-calendar-type="Gregorian", etc the week numbers were calculated wrong.
Fixes: #6835
Bug Description
Hi team,
This is an edge case, but when the config's calendarType is set to Islamic or Buddhist, and the date picker/calendar component has
![image](https://user-images.githubusercontent.com/38701667/228957896-3646f4c5-2e4d-44f8-9815-fc1a839c0c66.png)
primary-calendar-type
set to Gregorian, the week numbers that are displayed are wrong. Please see:This is because in the calculation it will get the
oJanFirst
from a new UniversalDate object, but this object will be an instance of the config calendar, so when it does the calculation on line 27, the result is way off. calculateWeekNumber.ts#L19(Note: This is not reproducible on openUI5, so I presume they have different logic to calculate the week number.)
Affected Component
Day Picker
Expected Behaviour
They week number will be the correct value per that calendar type being used for the component. (Note, week numbers are only used for Gregorian calendar)
Isolated Example
https://codesandbox.io/s/ui5-webcomponents-forked-4pphi9?file=/index.html
Steps to Reproduce
Please see the Isolated example. Open the date picker and see the week numbers are displayed incorrectly.
Log Output, Stack Trace or Screenshots
No response
Priority
Medium
UI5 Web Components Version
main
Browser
Chrome, Edge, Firefox, Safari
Operating System
All
Additional Context
No response
Declaration
The text was updated successfully, but these errors were encountered: