dylanwuzh/flutter-cupertino-date-picker

get an author value in on confirm callback

Opened this issue · 0 comments

i want to get the date with the format MM/yyyy when i select the date and press confirm i get the month equel to 06
my function :
onConfirm: (value){
print('================== value ===============');
print(value);
String year = value.year.toString().substring(value.year.toString().length - 2);
String month = (value.month.toString().length == 1)?'0${value.month.toString()}':value.month.toString();
expDateAdd.text = '$month/$year';
print('================== date ===============');
print(expDateAdd.text);
}