Skip to content

Commit

Permalink
skip VALUE properties on DTSTART when using the default value collect…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacadzaca committed Oct 29, 2022
1 parent b402962 commit d1b0a92
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/icalendar/prop.py
Expand Up @@ -292,20 +292,18 @@ def __init__(self, dt):
raise ValueError('You must use datetime, date, timedelta, '
'time or tuple (for periods)')
if isinstance(dt, datetime):
self.params = Parameters({'value': 'DATE-TIME'})
self.params = Parameters()
elif isinstance(dt, date):
self.params = Parameters({'value': 'DATE'})
elif isinstance(dt, time):
self.params = Parameters({'value': 'TIME'})
elif isinstance(dt, tuple):
self.params = Parameters({'value': 'PERIOD'})

if (isinstance(dt, datetime) or isinstance(dt, time))\
and getattr(dt, 'tzinfo', False):
tzinfo = dt.tzinfo
tzid = tzid_from_dt(dt)
if tzid != 'UTC':
self.params.update({'TZID': tzid})
tzid = tzid_from_dt(dt) if isinstance(dt, (datetime, time)) else None
if not tzid is None and tzid != 'UTC':
self.params.update({'TZID': tzid})

self.dt = dt

def to_ical(self):
Expand Down

0 comments on commit d1b0a92

Please sign in to comment.