flutter_datetime_picker icon indicating copy to clipboard operation
flutter_datetime_picker copied to clipboard

How to set date format from default YYYY-MM-DD to DD-MM-YYYY ?

Open hikmawanaz opened this issue 5 years ago • 5 comments

In package Flutter Cupertino Date Picker we can set dateformat using String dateFormat when initialize the package, So in this package how to set date format? because this default is YYYY-MM-DD, what i want is DD-MM-YYYY, i have read documentation but cant found how to set this. Its posible or not? i used en locale. thanks

hikmawanaz avatar Mar 11 '20 09:03 hikmawanaz

I would also like to show dd-mm-yyyy but don't know how to customize that in the custom class. Can you add this feature for localType.da or show us? Thanks

janlektonen avatar Mar 14 '20 10:03 janlektonen

You can create a custom picker to do this. Here is an example #93. Because a lot of people are requesting this. It would be a good idea to create a PR to apply changes from that issue. Or even better create a generic picker where we can pass the format as an argument.

Bryanx avatar Apr 20 '20 14:04 Bryanx

Here is an example #93 ,but Modify format date #21 issues not solved. in 1.5.0

buttonXin avatar Mar 11 '21 08:03 buttonXin

Any changes here? Tried to create a CustomModel, but have the same problem as others: Switching from a month with less 31 days to a month with 31 days does update the list only if I scroll to 31 (although 31 is not shown before).

sbergmair avatar Aug 06 '21 09:08 sbergmair

You can create a Fork and edit format in file lib/src/date_format.dart

anhhtbk avatar Jan 03 '23 10:01 anhhtbk