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

Recurring Event #12

Open
itsbriantruong opened this issue Jun 20, 2014 · 8 comments
Open

Recurring Event #12

itsbriantruong opened this issue Jun 20, 2014 · 8 comments

Comments

@itsbriantruong
Copy link

I am having trouble creating a recurring event. What parameters must be set? I keep getting invalid elements when I try to set parameters such as

calendar_item_type => 'RecurringMaster'

Can someone provide an example

@ebeigarts
Copy link
Owner

I haven't used recurring events :(

@itsbriantruong
Copy link
Author

ahh okay. Do you, by chance, know how to make it so attendees "accept" their invite automatically?

@ebeigarts
Copy link
Owner

Don't know, is that even possible?

@itsbriantruong
Copy link
Author

The Google Calendar api supports it, so I was hoping exchange would as well :/

@janis-vitols
Copy link
Contributor

I was also struggling to get recurring event's - solution was to patch find_item.rb and add this CalendarView to SOAP call specifying start & end date.
More about CalendarView

Not sure if I did the best implementation, but when I will refactor my code I could try to create Pull Request - let's hope somebody will be able to take a look on it :)

@ebeigarts
Copy link
Owner

@janis-vitols pull requests are welcome :)

@sled
Copy link

sled commented Sep 14, 2017

I figured out how to create recurring events, in my case I wanted an event to repeat every second week forever, here's what I did:

class WeeklyRecurrence < Exchanger::Element
  element :interval, :type => Integer
  element :days_of_week, :type => String
end

class NoEndRecurrence < Exchanger::Element
  element :start_date, type: String
end

class Recurrence < Exchanger::Element
  element :weekly_recurrence, :type => WeeklyRecurrence
  element :no_end_recurrence, type: NoEndRecurrence
end

calendar = Exchanger::Folder.find(:calendar, 'user@example.com')
item = calendar.new_calendar_item({
  start: '2017-09-14T11:42:18+02:00',
  end: '2017-09-14T12:42:18+02:00',
  subject: 'My Recurring Test Event',
  recurrence: Recurrence.new(
    no_end_recurrence: NoEndRecurrence.new(start_date: '2017-09-14+02:00'),
    weekly_recurrence: WeeklyRecurrence.new(interval: 2, days_of_week: 'Thursday')
  )
})
item.save

Remarks: Microsoft uses a date string with the time zone appended to the and as start date for the NoEndRecurrence so I just made it a String type instead of a Date type.

There are more recurring types such as "NumberedOccurences" etc.

@ebeigarts: If this is of any use for you I could start a PR with a proper implementation of those element types.

@ebeigarts
Copy link
Owner

@sled I'm not using exchanger anymore, but pull requests are welcome, maybe someone else needs this too.

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

No branches or pull requests

4 participants