[calendar] add timezone parameter to calendarevent in order order do get the good date/hours in ical exports

This commit is contained in:
Bezleputh 2015-09-11 15:53:21 +02:00
commit 0936e1dfc4
6 changed files with 28 additions and 3 deletions

View file

@ -128,6 +128,19 @@ class AgendadulibreModule(Module, CapCalendarEvent):
return self.browser.get_event(event_id)
def fill_obj(self, event, fields):
return self.browser.get_event(event.id, event)
event = self.browser.get_event(event.id, event)
choice = self.config['region'].get().split('#')
selected_region = '' if len(choice) < 2 else choice[-1]
if selected_region == '23':
event.timezone = 'America/Guadeloupe'
elif selected_region == '24':
event.timezone = 'America/Guyana'
elif selected_region == '26':
event.timezone = 'Indian/Reunion'
elif selected_region == '25':
event.timezone = 'America/Martinique'
else:
event.timezone = 'Europe/Paris'
return event
OBJECTS = {AgendadulibreBrowser: fill_obj}

View file

@ -645,4 +645,5 @@ class AllocineBrowser(Browser):
event.location = location
event.start_date = start_date
event.summary = summary
event.timezone = 'Europe/Paris'
yield event

View file

@ -30,3 +30,4 @@ class HybrideCalendarEvent(BaseCalendarEvent):
self.transp = TRANSP.TRANSPARENT
self.status = STATUS.CONFIRMED
self.category = CATEGORIES.CINE
self.timezone = 'Europe/Paris'

View file

@ -28,3 +28,4 @@ class RazibusCalendarEvent(BaseCalendarEvent):
self.transp = TRANSP.TRANSPARENT
self.status = STATUS.CONFIRMED
self.category = CATEGORIES.CONCERT
self.timezone = 'Europe/Paris'