Skip to content

Respect Android and iOS "Use 24-hour format" setting #11994

@yjbanov

Description

@yjbanov

By default, the time of day picker uses 12- or 24-hour format based on the locale. However, there is a setting "Use 24-hour format" that forces 24-hour format no matter what locale is chosen. Flutter's showTimePicker should respect this option.

Android

https://developer.android.com/reference/android/text/format/DateFormat.html#is24HourFormat(android.content.Context)

iOS

AFAICT there's no way to get it directly. One possibility is to have the NSDateFormatter format a sample time for a locale known to use 12-hour format. If the result is 24-hour format, then the "24-hour" setting must be enabled. Otherwise, it's not.

/cc @cbracken

Metadata

Metadata

Assignees

Labels

a: internationalizationSupporting other languages or locales. (aka i18n)engineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions