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

is24h flag didnt worked on Android #76

Open
daxter44 opened this issue May 1, 2023 · 0 comments
Open

is24h flag didnt worked on Android #76

daxter44 opened this issue May 1, 2023 · 0 comments

Comments

@daxter44
Copy link

daxter44 commented May 1, 2023

Describe the bug
At android platform, i set option is24h: true but always app shows 12h time picker.

To Reproduce
Steps to reproduce the behavior:

  1. Create an app
  2. Provide options:
    const locale = window.navigator.language;
    DatePicker.present({
    mode: pickerType,
    locale,
    date: this.date ? moment(this.date + ' ' + this.time).toISOString() : undefined,
    ios: {
    style: 'wheels',
    is24h: true,
    },
    android: {
    is24h: true,
    },
    }).then((date) => this.changeDateAndTime(date.value));
  3. Run app and open time picker

Expected behavior
App should open 24h time picker.

Smartphone (please complete the following information):

  • Device: Nexus 4
  • OS: API 33
  • Browser chrome
  • Version of date picker "@capacitor-community/date-picker": "^4.0.0",

Additional context
When I opened Android Studio and find for TimePickerDialog and edit flag options.is24h for static true value. This feature worked, but I can't use that solution beacon I want to set conditional to is24H.
final TimePickerDialog timePicker = new TimePickerDialog(context, theme, (TimePickerDialog.OnTimeSetListener) (view, hourOfDay, minute) -> {
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), hourOfDay, minute);
callback.resolve(Parse.dateToString(calendar.getTime(), options.format));
}, calendar.get(Calendar.HOUR), calendar.get(Calendar.MINUTE), options.is24h);

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

1 participant