compose-material-dialogs icon indicating copy to clipboard operation
compose-material-dialogs copied to clipboard

Using getDisplayName function to get dayOfWeek name may not a good idea

Open equationl opened this issue 2 years ago • 4 comments

By using getDisplayName to get dayOfWeek name in Chinese will get like this:

微信图片_20220517171323

It's will show all day, which in Chinese mean nothing, such as always show day in English.

I know this getDisplayName is from jvm:

image

So I test from Avd android 7.0 - Android 12. Both like this, I also using my Mi 10u(Android 12) test it, of course I get same result.

I found a same issue in other project: incorrect result of dayOfWeek.getDisplayName(TextStyle.NARROW, Locale.getDefault())

Using TextStyle.SHORT instead TextStyle.NARROW will show right text.

equationl avatar May 17 '22 09:05 equationl

I'm thinking about ability to inject the functionality from outside if necessary. Default function would be getDisplayName() but it can be overriden by the code similar to the one here. It's obviously a bug in the Android implementation, so it shouldn't be fixed by this library. @vanpra wdyt?

wojta avatar May 20 '22 19:05 wojta

I'm thinking about ability to inject the functionality from outside if necessary. Default function would be getDisplayName() but it can be overriden by the code similar to the one here. It's obviously a bug in the Android implementation, so it shouldn't be fixed by this library. @vanpra wdyt?

Yes. Although It not this library's problem, but may provide a function to set this paramter by user is a good idea.

equationl avatar May 23 '22 00:05 equationl

What is the status of this issue? Already fixed?

VladZawinski avatar Jun 20 '23 08:06 VladZawinski

What is the status of this issue? Already fixed?

I don't think so, But now compose already support Date Picker Dialog, You can try it.

equationl avatar Jun 20 '23 09:06 equationl