Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daylight Saving Months (November and March) Have Duplicated Date/Missing Date #43

Open
mingzew opened this issue Nov 20, 2024 · 2 comments

Comments

@mingzew
Copy link

mingzew commented Nov 20, 2024

The following code resulted in

Widget _buildDayCalendarTopScroll(BuildContext context) {
    DateTime now = DateTime.now();
    DateTime firstDateOfMonth = DateTime(now.year, now.month, 1);
    DateTime lastDateOfMonth = DateTime(now.year, now.month + 1, 0);
    return SizedBox(
      width: 100.w,
      child: Container(
        width: 100.w,
        child: EasyInfiniteDateTimeLine(
          firstDate: firstDateOfMonth,
          lastDate: lastDateOfMonth,
          focusDate: DateTime.now(),
          controller: EasyInfiniteDateTimelineController(),

          locale: 'en_US',
        ),
      ),
    );
  }

Duplicated date on November 3rd:
Screenshot 2024-11-19 at 11 28 31 PM
Missing the 30th:
Screenshot 2024-11-19 at 11 28 57 PM

If I set the date to March 2025, it's missing 31st
Screenshot 2024-11-19 at 11 32 10 PM

This problem occurs for all daylight saving month/date in the US. The device is in "America/New_York" timezone

@mingzew
Copy link
Author

mingzew commented Nov 20, 2024

I've ported the above to use the latest v2.0.2's EasyDateTimeLinePicker instead, like below

  Widget _buildDayCalendarTopScroll(BuildContext context) {
    DateTime firstDateOfMonth = DateTime(2025, 3, 1);
    DateTime lastDateOfMonth = DateTime(2025, 3, 31);

    return SizedBox(
      width: 100.w,
      child: Container(
        width: 100.w,
        child: EasyDateTimeLinePicker(
          focusedDate: DateTime(2025, 3, 1),
          controller: EasyDatePickerController(),
          firstDate: firstDateOfMonth,
          lastDate: lastDateOfMonth,
          onDateChange: (date) {
          },
          locale: Locale('en', 'US'),
          itemExtent: 15.w,
          daySeparatorPadding: 3.w,
          timelineOptions: TimelineOptions(
              height: 8.h,
          ),
          headerOptions: HeaderOptions(
            headerType: HeaderType.none,
          ),
        ),
      ),
    );
  }

When I set the month to March 2025, or 2026 it still don't show the 31st. Maybe daylight saving related?
Screenshot 2024-11-20 at 12 18 35 AM

@FadyFayezYounan
Copy link
Owner

@mingzew Thank you for your feedback. I have just updated the package; you can try again now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants