Chris1234567899 / flutter_time_range_picker

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

Bug: endTime 23:59 is automatically changed to 24:00 #23

Closed a-bullert closed 3 years ago

a-bullert commented 3 years ago

Hi there! :) Thank you for creating and maintaining this nice package!

Unfortunately we have found an issue, that is bugging us: When calling showTimeRangePicker with start = 0:00 and end = 23:59, the endTime is changed to 24:00. This seems to happen in time-range-dialog.dart in initState() of _TimeRangePickerState. If I'm not mistaken, it is not required to manipulate the end time, we can simply use it as it is: Line 300 should be _endTime = endTime; instead of _endTime = _roundMinutes(endTime.hour * 60 + endTime.minute * 1.0);

It might be related to this issue?

Thank you!

Chris1234567899 commented 3 years ago

Hi, did you check the interval parameter? It is a duration (default 5 minutes) that all times (start, end & selection) are rounded to. So if you set 23:59 it will round to 24:00. Can you try to set the interval to 1 Minute or smaller and report back in case this problem persists?

a-bullert commented 3 years ago

Hi! Thank you so much for your quick reply! Yes, that works like a charm! :) I'm sorry, I overlooked that parameter.

Chris1234567899 commented 3 years ago

No problem, good luck with your project.