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

Unable to correctly handle 24-hour and 12-hour time formats #149

Closed
goddaneel opened this issue Jun 23, 2024 · 7 comments · Fixed by #152
Closed

Unable to correctly handle 24-hour and 12-hour time formats #149

goddaneel opened this issue Jun 23, 2024 · 7 comments · Fixed by #152
Labels
bug Something isn't working

Comments

@goddaneel
Copy link

goddaneel commented Jun 23, 2024

Steps to reproduce

  1. Click on "Income/Expenses".
  2. Modify the time by clicking on the Time of Day option.
  3. Select a time greater than 12:00. For example, 20:00.
  4. Click Apply, then Save.

Expected behaviour

Save and display as 20:00 or 8:00 pm .

Actual behaviour

Save and display as 8:00 am .

Device name

oneplus ace3

Android version

android 14

GreenStash version

3.7.0 (f-droid)

Device logs

No response

Additional information

No response

@starry-shivam
Copy link
Member

Click on "Income/Expenses".

Sorry but there isn't any Income/expense button or screen I'm aware of, Can you please provide bit more details to reproduce this?

@goddaneel
Copy link
Author

Sorry but there isn't any Income/expense button or screen I'm aware of, Can you please

Sorry, it should say withdraw/deposit (+/- buttons in compact view).

@starry-shivam
Copy link
Member

Sorry, it should say withdraw/deposit (+/- buttons in compact view).

Thanks, yes I'm able to reproduce it now, will try to fix it in next update.

@starry-shivam starry-shivam added the bug Something isn't working label Jun 23, 2024
@goddaneel
Copy link
Author

Sorry, it should say withdraw/deposit (+/- buttons in compact view).

Thanks, yes I'm able to reproduce it now, will try to fix it in next update.

Thanks and looking forward to your next update.

One more thing, I just found that in English environment, I can modify the year, month, and day, but in Simplified Chinese environment, I can only modify the day. I don't know if this is a bug or intentional.

@starry-shivam
Copy link
Member

One more thing, I just found that in English environment, I can modify the year, month, and day, but in Simplified Chinese environment, I can only modify the day. I don't know if this is a bug or intentional.

I'll have to look into this, thanks for reporting. I'll get back to you once I've some information regarding that

@starry-shivam
Copy link
Member

So, I looked into this and couldn't really figure out what's going wrong from my end to cause incorrect behavior in the Chinese locale. So, I browsed some open issues on sheets-compose-dialogs (the library I use to show calendar and datetime dialogs) and found this: maxkeppeler/sheets-compose-dialogs#57. I think this may be the reason why it's not working properly in the Chinese locale.

Regarding the other issue of the incorrect AM/PM, I was indeed able to reproduce it on my real device (Xiaomi POCO F5/Redmi Note 12 Turbo), where it didn't work in both 24-hour format and 12-hour format (It didn't even show me the option to select AM/PM in 12-hour format). However, for some reason, it seems to work fine on Android Studio's emulator?! I really have no idea why. I think it's also some problem or bug with the library, though I can't say for sure.

I also found this issue: maxkeppeler/sheets-compose-dialogs#53, which I personally agree with. It took me quite a few tries to understand how it's supposed to work, and I believe it could be confusing for users as well.

Considering all of this, I think it would be wise to switch to the standard Android library at least for the datetime picker, or maybe look at some other alternatives because there seem to be multiple issues with the current implementation.

@starry-shivam
Copy link
Member

I found an easier way to fix most of these issues by manually setting the locale in datetime-picker's config. I'll go with this for now, as it fixes all of the aforementioned issues apart from maxkeppeler/sheets-compose-dialogs#53 with just one line of change. Regarding maxkeppeler/sheets-compose-dialogs#53, nobody has complained about it yet, so I'll sleep on it for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants