flutter_datetime_picker icon indicating copy to clipboard operation
flutter_datetime_picker copied to clipboard

DatePicker.showDateTimePicker maxTime not working

Open mikechari opened this issue 4 years ago • 2 comments

Hi I noticed that DatePicker.showDateTimePicker is not blocking future dates when I set maxTime: DateTime.now(),

Here is the code:

return TextButton(
        onPressed: () {
          DatePicker.showDateTimePicker(
            context,
            showTitleActions: true,
            minTime: DateTime(2021, 9, 1),
            maxTime: DateTime.now(),
            theme: DatePickerTheme(
              cancelStyle: Theme.of(context).textTheme.bodyText1!,
              doneStyle: Theme.of(context).textTheme.bodyText1!,
              itemStyle: Theme.of(context).textTheme.bodyText2!,
            ),
            onChanged: (date) {
              print('change $date');
            },
            onConfirm: (date) {
              print('confirm $date');
            },
            currentTime: DateTime.now(),
          );
        },
        child: const Text(
          'show date time picker (Chinese)',
          style: TextStyle(color: Colors.blue),
   ));

And an image image

It should be showing only DateTime.now() as max date/ time

Thanks in advance!

mikechari avatar Oct 18 '21 20:10 mikechari

I can confirm this issue still exists.

underline9396 avatar Nov 12 '22 17:11 underline9396

@rasekoli Have you fixed this, I can still reproduce it

CheesePeanut avatar Jun 17 '23 18:06 CheesePeanut