hoangnm / react-native-week-view

Week View Component for react-native
MIT License
281 stars 98 forks source link

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

Open darren4flow opened 3 months ago

darren4flow commented 3 months ago

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.

Additional context (optional):