Skip to content

BUG: duplicate 1:00 time label because of daylight savings #339

Description

@darren4flow

Bug description:
clear and concise description
Today we had daylight savings which is resulting in 1:00 being shown instead of 2:00 in the time labels causing duplicate 1:00 keys.

Visual demo:
Screenshots, videos or gifs to help explain your problem
image
Code to reproduce

import WeekView from 'react-native-week-view';

const myEvents = [
  {
    id: 1,
    startDate: new Date(2023, 1, 20, 9),
    endDate: new Date(2023, 1, 20, 11),
    color: 'blue',
    description: 'E1',
    // ... more properties if needed,
  },
  {
    id: 2,
    startDate: new Date(2023, 1, 22, 10),
    endDate: new Date(2023, 1, 22, 11, 30),
    color: 'red',
    description: 'E2',
  },
  // more events...
];

const MyComponent = () => (
  <WeekView
    events={myEvents}
    selectedDate={new Date(2023, 1, 20, 12)}
    numberOfDays={7}
    pageStartAt={{ weekday: 1 }}
  />
);

Environment:
The latest code
Important: using your own fork makes this more difficult to reproduce and solve. We recommend trying with the latest week-view version.

  • react-native-week-view: version X
  • react-native-gesture-handler: version X
  • react-native-reanimated: version X
  • react-native: version X
  • react: version X
  • OS: android / iOS

Additional context (optional):

  • Error message or traceback (if any)
  • Steps to reproduce
  • ...
    Using the calendar on a day that has daylight savings will result in a duplicate key error because of two 1:00 keys for hour labels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions