FadyFayezYounan / easy_date_timeline

The "easy_date_timeline" package is a customizable Flutter widget that displays a timeline of dates in a horizontal timeline.
MIT License
95 stars 45 forks source link

EasyInfiniteDateTimeLine : Today date is duplicated #39

Open SkilyFrance opened 2 weeks ago

SkilyFrance commented 2 weeks ago

Hello, Thanks for this package.

The current day seems to be duplicated on EasyInfiniteDateTimeLine : DIM. 27 OCT in this case.

return EasyInfiniteDateTimeLine( locale: 'fr_FR', selectionMode: const SelectionMode.alwaysFirst(), firstDate: DateTime(2024, 9, 1), focusDate: focusDate, lastDate: focusDate.add(const Duration(days: 365)), onDateChange: onDateChange, dayProps: _dayProps(context), showTimelineHeader: false, headerBuilder: (BuildContext context, DateTime date) => const SizedBox(), );

Do you have any idea to fix it ?

Thanks ! Screenshot_20241027-150210

GregoryHappy commented 2 weeks ago

Hello ! Thanks a lot for this useful package ! I have exactly the same issue with Sunday 27 October which is duplicated in my app just for this date :( Is there a quick fix or workaround for this bug ?

Thanks a lot and have a good day !

Grégory

FadyFayezYounan commented 2 weeks ago

@SkilyFrance , @GregoryHappy Thank you for taking the time to report these issues with the package. I appreciate you bringing them to my attention. In the meantime, as I work to resolve the issues and publish an update on pub.dev, I would suggest trying to use the package directly from the GitHub repository. This will allow you to use the latest code, which may already contain fixes for the problems you've encountered.

GregoryHappy commented 1 week ago

Hello @FadyFayezYounan ! Thanks for your quick answer !

I gave a try with the github version but it seems I have trouble with EasyDateFormatter : "Flutter Doesn't find it / the class doesn't exist anymore ?"

So I came back to the pub.dev version at that time !

Do you have an idea if it's a difficult one to fix and if it's going to take you a lot of time ?

Have a good day !

Grégory

FadyFayezYounan commented 1 week ago

Give it a try now from GitHub

GregoryHappy commented 1 week ago

Hello @FadyFayezYounan ! Yes ! I test it from github repository and the compilation is now OK for EasyDateFormatter

=> I did 2 screenshots to show you the duplicated date on Sunday 27 October and I think it's related with the fact that when you put lastDay = today you will have in reality on the calender lastday=today-1 like you can see in my second screeshot.

Have a good day !

Grégory

Duplicated date:

Capture d’écran 2024-11-01 à 09 43 51

Date of the "today" is not shown: (miss 1 day)

Capture d’écran 2024-11-01 à 09 50 28
Bendix20 commented 13 hours ago

There was a problem when adding days to a date or calculating the days between two dates. This was done by calculating with durations. But because of time shift some days in some countries can have more or less then 24h. I created a pull request with a fix: https://github.com/FadyFayezYounan/easy_date_timeline/pull/41