React-native-calendars: Able to mark dates based on iCal rrule

Created on 12 Apr 2018  路  9Comments  路  Source: wix/react-native-calendars

eg:

FREQ=WEEKLY;DTSTART=20120201T093000Z;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR

there is a grate lib for this: https://github.com/jakubroztocil/rrule

All 9 comments

hi, please provide a more in depth description of your issue

If i have a calendar event and its repeating every Monday then i wish to mark all those dates in the calendar. Even when I switch month.

Or for instance: I can have one calendar event that is repeating every year when it's Bobs birthday.

taking this string for example that repeats every monday FREQ=WEEKLY;WKST=MO

http://jakubroztocil.github.io/rrule/#/rfc/FREQ=WEEKLY;COUNT=30;WKST=MO

it's a never ending event

Is this currently possible?

no

any updates on this? I'm also looking for a good option for repeating/recurring events with react-native-calendars. The only way I can think right now is by interpreting the rules myself and programmatically generate new event items based on the rules.

I don't think a presentation component should have to deal with those concerns. This feels more like a user-land problem more than it does a library problem.

You could get good mileage by composing react-native-calendars with a thin-wrapper that interpolates the RRULE into a collection of events, and then use react-native-calendars as you normally would:

function ICalCalendar({rrule, ...props}) {
  const events = buildEventsFromRRule(rrule)

  return <Calendar {...props} markedDates={dateMarkingsFromEvents(events)} />
}

Thanks for the response @ajwhite . Actually, the recurring events I'm dealing with don't come from Google Cal but from a custom private events/calendar API. I've created custom functions to interpret the repeating rules and create individual events accordingly, as you suggested above, and it's working great.

Hey that's great to hear @esdrasevt. It's pretty fascinating how the RRule is expressed into event instances on a calendar app (how they're kinda "virtual" things, not really there unless you create an exception).

I've shared the process of exploring how these work at @robinpowered, we do a lot with iCal too.

Anyways, glad to hear you're in business 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ercpereda picture ercpereda  路  4Comments

kewin1807 picture kewin1807  路  4Comments

dobiedad picture dobiedad  路  4Comments

sommeshEwall picture sommeshEwall  路  3Comments

henrikra picture henrikra  路  3Comments