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

24h time format for TimePickerBuilder() #374

Open
rohnstock opened this issue Dec 11, 2017 · 1 comment
Open

24h time format for TimePickerBuilder() #374

rohnstock opened this issue Dec 11, 2017 · 1 comment

Comments

@rohnstock
Copy link

Hello,

for the RadialTimePickerDialogFragment() is a "setForced24hFormat" method available.
Is there something similar for the TimePickerBuilder() to force the 24h time format ?

@cesiztel
Copy link

cesiztel commented Jan 24, 2019

Hi @rohnstock

I do not think that is the right desition, but what I did in my project is create my own version of TimePicker and TimePickerDialogFragment and a method like setForced24hFormat.
By default, TimePicker will take the default locale to se the format. Due to you can not extend the properties, I have created my own version.

So, finally I could do something like this:
final TimePickerDialogFragment dialog = TimePickerDialogFragment.newInstance(0, R.style.BetterPickersDialogFragment_Light); dialog.setForced24hMode(); dialog.setTimePickerDialogHandlers(handlers); dialog.show(fragmentManager, TimePickerDialogFragment.class.getSimpleName());

But the ideal would be fork the project and add this kind of feature to all the components.

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

No branches or pull requests

2 participants