Chris1234567899 / flutter_time_range_picker

A time range picker for Flutter
MIT License
33 stars 53 forks source link

Fix use24hourdateformat #7

Closed vladnicula closed 3 years ago

vladnicula commented 3 years ago

Hey there,

It seems the 24-hour format is not working. I fixed with what I think is minimal code added. I'm new to flutter, this might not be the best way to do it, but it worked for me.

Related: https://github.com/Chris1234567899/flutter_time_range_picker/issues/6

image

image

Code I used to test this is:

ElevatedButton(
          child: Text('Pick'),
          onPressed: () async {
            // thePickers.showDialog(context);
            TimeRange result = await showTimeRangePicker(
                context: context,
                fromText: '',
                toText: '',
                ticks: 48,
                snap: true,
                use24HourFormat: false, // or commented out, or true
                interval: Duration(minutes: 30));

            print(result);
          },