Reputation: 23
Based on requirement, I need to use the same date picker style for the the application both IOS and Android using the CupertinoDatePicker like this:
Widget datetime() {
return CupertinoDatePicker(
initialDateTime: DateTime.now().subtract(Duration(days: 1)),
onDateTimeChanged: (DateTime newdate) {
print(newdate);
},
use24hFormat: true,
maximumDate: new DateTime(2020, 12, 30),
minimumYear: 2010,
maximumYear: 2020,
minuteInterval: 1,
mode: CupertinoDatePickerMode.date,
);
}
However I need to custom the display of the picker to show day of the week (EEE, example Mon 21) and swap picker position to (date with day of week name, month, year) in the CupertinoDatePicker. I need to display like this: Thu 21 - Nov - 2019 (select day, select month, and select year). How to create custom cupertinodatepicker like this?
Result: Result
Expected: Expected
Upvotes: 1
Views: 2932
Reputation: 340
Date order can also be changed natively already. Here's the documentation link. :)
Upvotes: 0