syncfusion / flutter-examples

This repository contains the Syncfusion Flutter UI widgets examples and the guide to use them.
Other
1.98k stars 775 forks source link

Calendar: TimeSlotViewSettings startHour and endHour doesn't support minutes that are not divisible by 60 #686

Closed GunesYurdakul closed 2 years ago

GunesYurdakul commented 2 years ago

StartHour and endHour in the TimeSlotView settings are expecting double. But for the minutes that are not divisible by 60, the result are not correct. Either it shows times like 18:21 etc. or it is completely buggy like in the example below.

For example if the startHour is set to 7:10 (7.1666666667) and the endHour to 19:20(19.3333333333) and if the time interval is set to 15. The result is completely incorrect as you can see below.

Screenshot 2022-10-04 at 12 45 20

It could be nice if you could support it.

MuniappanSubramanian commented 2 years ago

Hi GunesYurdakul,

#Regarding TimeSlotViewSettings startHour and endHour doesn't support minutes that are not divisible by 60 We have checked your requirement and If the custom startHour and endHour are given in the Flutter calendar, then the number of time slots calculated based on the given startHour and endHour should result in an integer value, otherwise, the next immediate time interval will be considered until the result is an integer value. It is the expected behavior of the Flutter calendar.

Please refer to our UG documentation to know more details about start hour and end hour customization in the calendar,https://help.syncfusion.com/flutter/calendar/timeslot-views#flexible-working-days-and-working-hours

We hope that this helps you. Please let us know if you need further assistance.

Regards, Muniappan S

GunesYurdakul commented 2 years ago

Thanks for your response,

I found a work around already. But I still think for these case the calendar should round down the start time and/or round up the date time, so we at least can see a normal looking calendar. I think it can be a nice improvement.

GunesYurdakul commented 2 years ago

If anyone needs, some more information about how to compute the double value from TimeOfDay:

https://www.syncfusion.com/forums/178095/sfcalendar-with-custom-interval-calendar-time-precision-is-incorrect