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 bug in calendar model #763

Merged
merged 9 commits into from
Aug 23, 2023

Conversation

alexzhirkevich
Copy link

@alexzhirkevich alexzhirkevich commented Aug 21, 2023

Proposed Changes

Fixed bug from #717 described in https://kotlinlang.slack.com/archives/CJLTWPH7S/p1692632685323839 (you can reproduce it if you set TimeZone.setDefault(TimeZone.getTimeZone("GMT-5")) on desktop)

getMonth and getCannonicalDate should not be converted to local time zone. It should retain UTC (you can see it in legacy impl). The only method that uses system TZ should be getDayOfWeek

By mistake my GMT+3 time zone and time zone on CI somehow passed all the tests copied from android source set. But it was not the case for example for the GMT-5. I apologise for that.


Added non-localized format for desktop instead of ugly skeleton-format without spaces (#717 (comment)) until it properly implemented.

Reordered locale and pattern paremeters for dawin. Locale should be applied before pattern.

Testing

Test: 4 new tests in KotlinxDatetimeCalendarModel performed in different time zones

@mazunin-v-jb
Copy link

Thanks for the PR!
I'll pass it on to the team for review.

@dima-avdeev-jb dima-avdeev-jb merged commit 1dbd593 into JetBrains:jb-main Aug 23, 2023
@alexzhirkevich alexzhirkevich deleted the fix_timezone branch July 15, 2024 09:10
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.

3 participants