Skip to content

Commit

Permalink
fix event creation in ikhal
Browse files Browse the repository at this point in the history
broken with the last big typing/refactoring commit
  • Loading branch information
geier committed Jul 2, 2022
1 parent 8827610 commit 3d8046a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion khal/khalendar/khalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def create_event_from_dict(self,
"""Creates an Event from the method's arguments
"""
vevent = new_vevent(locale=self._locale, **event_dict)
calendar_name = calendar_name or self.default_calendar_name
calendar_name = calendar_name or self.default_calendar_name or self.writable_names[0]
assert calendar_name is not None
return self.create_event_from_ics(vevent.to_ical(), calendar_name)

Expand Down
7 changes: 3 additions & 4 deletions khal/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def duplicate(self):
except IndexError:
pass

def new(self, date: dt.datetime, end: Optional[dt.datetime]=None):
def new(self, date: dt.date, end: Optional[dt.datetime]=None):
"""create a new event on `date` at the next full hour and edit it
:param date: default date for new event
Expand All @@ -884,14 +884,13 @@ def new(self, date: dt.datetime, end: Optional[dt.datetime]=None):
dtstart = date
dtend = end + dt.timedelta(days=1)
allday = True
event = self.pane.collection.generate_event(
event = self.pane.collection.create_event_from_dict(dict(
dtstart=dtstart,
dtend=dtend,
summary='',
timezone=self._conf['locale']['default_timezone'],
locale=self._conf['locale'],
allday=allday,
)
))
self.edit(event)

def selectable(self):
Expand Down

0 comments on commit 3d8046a

Please sign in to comment.