flutter_calendar_view
flutter_calendar_view copied to clipboard
DayView shows today's event tomorrow
Steps to reproduce: Open https://simformsolutionspvtltd.github.io/flutter_calendar_view/#/ Review MonthView - there are two event planned for today Switch to DayView - no events today
You can also add an event with date - today and you will see it tommorrow, not today.
I guess the wrong _currentIdex calculation is due to DateTime.difference and Duration.inDays() disalignment when considering Daylight Saving Time, as also stated in DateTime.difference() documentation.
To fix this we have to compare dates in utc, e.g.:
/// Gets difference of days between [date] and calling object.
int getDayDifference(DateTime date) =>
DateTime.utc(year, month, day).difference(DateTime.utc(date.year, date.month, date.day)).inDays.abs();
Have a look at PR #104
I guess the wrong _currentIdex calculation is due to DateTime.difference and Duration.inDays() disalignment when considering Daylight Saving Time, as also stated in DateTime.difference() documentation.
To fix this we have to compare dates in utc, e.g.:
/// Gets difference of days between [date] and calling object. int getDayDifference(DateTime date) => DateTime.utc(year, month, day).difference(DateTime.utc(date.year, date.month, date.day)).inDays.abs();
Have a look at PR #104
How would I go about fixing this locally until they can get this fix out?
Hello guys, Please let us know if this issue is still there in version 1.0.0
Hello guys, Please let us know if this issue is still there in version 1.0.0
I actually think this issue might have been introduced in 1.0.0, when I downgrade to 0.0.5 it seemed to go away. For me at least.
Downgrading to 0.0.5 from 1.0.0 also fixed the issue for me.
@ParthBaraiya yes - this bug is present in 1.0.0
how is this still labeled as waiting for a response? multiple people commented that this is a critical bug in version 1.0 - that basically makes this component unusable. Do you guys have any plan on fixing this issue?
Fixed in 1.0.1 PR #136