vkurko/calendar

Support to reset events.

phpcodebooster opened this issue · 6 comments

Right now when I load calendar initially I add all events. However when view changes from day to say week. I need to re fetch events based on week timeframe. This causes duplication in same events within a period earlier.

Something is most likely wrong with the way you are loading data into the calendar. You don't need to force refetchEvents() to be called when navigating the calendar if you use eventSources. Can you show your code to make it clearer?

Can you show your code to make it clearer?

@phpcodebooster any update on this?

@vkurko can you show me an example of how event source can be used effectively?

  1. on initial load fetching remote events
  2. creating new event and adding it manually to calendar works fine
  3. when I change calendar view from say week to month and call eventCalendar.updateEvent(e)) creates duplicates

Please see this comment. If you still need further clarification, I will try to help.

@vkurko thanks for details I resolved this issue however now I am seeing different issue.

  1. in my calendar toronto time GMT -4 hours. I am saving an event from 02:00 AM to 06:00 AM
  2. I am saving this event in my database
    "end": "2024-04-10T10:00:00+00:00",
    "start": "2024-04-10T06:00:00+00:00"
    as UTC time because UTC is ahead 4 hours
  3. when i supply this UTC date as events in my calendar my calendar shows me this event starts at 06:00 to 10:00 AM this is incorrect. I should see my original event time in my calendar which should be -4 hours behind UTC if given dates are in UTC
    "end": "2024-04-10T10:00:00+00:00",
    "start": "2024-04-10T06:00:00+00:00"

it should show me 02:00 AM to 06:00 AM not 06:00 AM to 10 AM

Unfortunately, time zones are not currently supported in Event Calendar. Therefore, you need to convert the time yourself, for example, on the server side when preparing a response to the calendar.