Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Calendar - Day Picker]: Week numbers are incorrectly calculated #6835

Closed
1 task done
allen138 opened this issue Mar 30, 2023 · 1 comment · Fixed by #8971
Closed
1 task done

[Calendar - Day Picker]: Week numbers are incorrectly calculated #6835

allen138 opened this issue Mar 30, 2023 · 1 comment · Fixed by #8971
Assignees
Labels
bug This issue is a bug in the code Medium Prio SAP SF TOPIC B

Comments

@allen138
Copy link

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 primary-calendar-type set to Gregorian, the week numbers that are displayed are wrong. Please see:
image

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

  • I’m not disclosing any internal or sensitive information.
@allen138 allen138 added the bug This issue is a bug in the code label Mar 30, 2023
@Lyserg-Diethel Lyserg-Diethel self-assigned this Mar 31, 2023
@Lyserg-Diethel Lyserg-Diethel added this to New Issues in Maintenance - Topic B via automation Mar 31, 2023
@Lyserg-Diethel
Copy link

Hello @SAP/ui5-webcomponents-topic-b,

The issue is reproducible on the main branch. Could you please check this?

Best regards,
Stefan

@Lyserg-Diethel Lyserg-Diethel removed their assignment Mar 31, 2023
@Todor-ads Todor-ads self-assigned this Jan 17, 2024
@Todor-ads Todor-ads moved this from New Issues to In Progress in Maintenance - Topic B Jan 17, 2024
@Todor-ads Todor-ads moved this from In Progress to New Issues in Maintenance - Topic B May 8, 2024
@Todor-ads Todor-ads removed their assignment May 8, 2024
@hinzzx hinzzx self-assigned this May 10, 2024
@hinzzx hinzzx moved this from New Issues to In Progress in Maintenance - Topic B May 10, 2024
Maintenance - Topic B automation moved this from In Progress to Completed May 21, 2024
ilhan007 pushed a commit that referenced this issue May 23, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code Medium Prio SAP SF TOPIC B
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants