Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 30350

Expo calendar event get removed on android if the timezone of device is change

$
0
0

I was working on expo calendar recently. I came across a problem that on ANDROID, whenever I create a new calendar event and change the timezone of the device, then the event is removed from the calendar.

Here are my configurations:

For calendar:

const newCalendar = {
    title: 'Test',
    entityType: Calendar.EntityTypes.EVENT,
    color: 'red',
    sourceId:
      Platform.OS === 'ios'&&
      calendars.find(
        cal =>
          (cal.source && cal.source.name === CALENDAR_SOURCE_IOS.DEFAULT) ||
          (cal.source && cal.source.name === CALENDAR_SOURCE_IOS.I_CLOUD)
      ).source.id,
    source: Platform.OS === 'android'&& {
      name: calendars.find(cal => cal.accessLevel === Calendar.CalendarAccessLevel.OWNER).source
        .name,
      isLocalAccount: true,
    },
    name: 'Test',
    accessLevel: Calendar.CalendarAccessLevel.OWNER,
    ownerAccount:
      Platform.OS === 'android'&&
      calendars.find(cal => cal.accessLevel === Calendar.CalendarAccessLevel.OWNER).ownerAccount,Calendar.CalendarAccessLevel.OWNER).ownerAccount,
    allowsModifications: false,
    isVisible: true,
  }

For Event:

const event = {
      title: 'test event',
      startDate: testStartDate,
      endDate: testEndDate,
      location: 'Test location',
      timeZone: Localization.timezone,
      endTimeZone: Localization.timezone,
    }

The behavior on iOS on changing the timezone is: the event date is updated in calendar. (which is the expected behavior).

On Android: On changing the timezone of the device, the event is removed.


Viewing all articles
Browse latest Browse all 30350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>