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

fix(ui5-calendar): respect component level calendarType in week calculation #8971

Merged
merged 1 commit into from
May 21, 2024

Conversation

hinzzx
Copy link
Contributor

@hinzzx hinzzx commented May 15, 2024

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.

	<script data-ui5-config type="application/json">
	{
          "language": "en_US",
          "rtl": false,
          "calendarType": "Islamic"
        }
	</script>
<ui5-date-picker primary-calendar-type="Gregorian"></ui5-date-picker>

image

After the change, the weeks are calculated correctly now.

image

Fixes: #6835

@unazko unazko self-requested a review May 16, 2024 14:55
Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works the same way as in the openui5 project with en_US and en_GB locales.

@tsanislavgatev
Copy link
Contributor

I thought of a test, but the simulation would mean to create another test page with specific parameters as this is quite an edge case.

@hinzzx hinzzx marked this pull request as ready for review May 21, 2024 06:17
@hinzzx hinzzx merged commit 69b8003 into main May 21, 2024
10 checks passed
@hinzzx hinzzx deleted the calc-week-num-fix branch May 21, 2024 06:18
hinzzx added a commit that referenced this pull request May 22, 2024
…lation (#8971)

Fixed edge case where 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, the week numbers were calculated wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Calendar - Day Picker]: Week numbers are incorrectly calculated
3 participants