Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RRule Object #44

Open
AbouJalal opened this issue Sep 20, 2017 · 2 comments
Open

RRule Object #44

AbouJalal opened this issue Sep 20, 2017 · 2 comments
Labels

Comments

@AbouJalal
Copy link

Hi,

It's a how-to question not an issue but don't know where to ask.

I have a content search webpart that using a display template to show the events. I followed the steps in this link: http://www.avtex.com/2016/04/generate-and-download-an-ical-event-in-sharepoint/.
My webpart now is showing all items and i added a "Add to Calendar" button under each event.
I even managed to know which "ctx.currentitem" is a recurring event. The problem now reside on how to expand this item to get all the information to construct the "RRule object" to be able to add to "cal.addEvent" function.

@nwcell
Copy link
Owner

nwcell commented Sep 20, 2017

It's an object that maps to the ics standards rrule string.

https://github.com/nwcell/ics.js/blob/master/ics.js#L61
https://github.com/nwcell/ics.js/blob/master/ics.js#L149

I'd dig into the ics specs if you wanted to learn more.

@nwcell nwcell closed this as completed Sep 20, 2017
@nwcell nwcell reopened this Sep 20, 2017
@AbouJalal
Copy link
Author

Thanks for your help nwcell and for you fast respond!

Still don't get how to parse the data that i have into the rrule object.
I have built an array: recData.push({'RecurrenceData' : data.d.RecurrenceData}, {'EventDate' : data.d.EventDate}, {'EndDate' : data.d.EndDate}, {'Duration' : data.d.Duration}, {'EventType' : data.d.EventType});
RecurrenceData has: "<recurrence><rule><firstDayOfWeek>su</firstDayOfWeek><repeat><monthly monthFrequency="1" day="26" /></repeat><repeatForever>FALSE</repeatForever></rule></recurrence>"
EventDate has: 8/25/2017 6:00 PM
EndDate has: 10/26/2100 5:59 PM
Duration has: 86,340
EventType has: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants