exchanger icon indicating copy to clipboard operation
exchanger copied to clipboard

Recurring Event

Open itsbriantruong opened this issue 11 years ago • 8 comments

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

itsbriantruong avatar Jun 20 '14 16:06 itsbriantruong

I haven't used recurring events :(

ebeigarts avatar Jun 24 '14 15:06 ebeigarts

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

itsbriantruong avatar Jun 24 '14 16:06 itsbriantruong

Don't know, is that even possible?

ebeigarts avatar Jun 24 '14 16:06 ebeigarts

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

itsbriantruong avatar Jun 24 '14 16:06 itsbriantruong

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 :)

janis-vitols avatar Mar 11 '16 08:03 janis-vitols

@janis-vitols pull requests are welcome :)

ebeigarts avatar Mar 11 '16 08:03 ebeigarts

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, '[email protected]')
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.

sled avatar Sep 14 '17 09:09 sled

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

ebeigarts avatar Sep 14 '17 09:09 ebeigarts