date_time_picker icon indicating copy to clipboard operation
date_time_picker copied to clipboard

Time not displaying in 12hrs format

Open pbhuvanesh opened this issue 4 years ago • 3 comments

I've use24hours: false and yet I see 24hrs format in the text field. How do I fix this?

pbhuvanesh avatar Feb 11 '21 08:02 pbhuvanesh

In materialApp widget try to set supportedLocales with Locale('en', 'US') and the other locale you want. Then, in DateTimePicker, set the parameters use24HourFormat: false, and locale: 'with your prefered locale' as Locale('pt', 'BR'),

It will work.

hslbetto avatar Mar 03 '21 01:03 hslbetto

The above workaround does not work for me

I submitted a pull request to fix it #37

StorminGorman avatar Apr 10 '21 20:04 StorminGorman

when you want to use 'use24hours' field you have to use 'locale', it works for me.

use24HourFormat: false, locale: const Locale('en', 'US'),

bijoya-banik avatar Feb 23 '22 06:02 bijoya-banik