Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 25 additions & 15 deletions open_web_calendar/convert/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,30 @@ def create_participant_from(
return participant

def convert_ical_event(self, calendar_index, calendar_event: Event):
start = calendar_event.start
end = calendar_event.end
if is_date(start) and is_date(end) and start == end:
end = start + datetime.timedelta(days=1)
location = Location(calendar_event, self.location_spec)
name = calendar_event.get("SUMMARY", "")
sequence = calendar_event.sequence
uid = calendar_event.uid
start_date = self.date_to_string(start)
location_map: dict[str, str] | None = {
"text": location.text,
"url": location.url,
}
if not location_map["text"] and not location_map["url"]:
location_map = None
start = calendar_event.start
end = calendar_event.end
if is_date(start) and is_date(end) and start == end:
end = start + datetime.timedelta(days=1)

location = Location(calendar_event, self.location_spec)
name = calendar_event.get("SUMMARY", "")

raw_categories = calendar_event.categories or []
categories = []
for cat in raw_categories:
categories.append(str(cat).strip())

sequence = calendar_event.sequence
uid = calendar_event.uid
start_date = self.date_to_string(start)

location_map: dict[str, str] | None = {
"text": location.text,
"url": location.url,
}
if not location_map["text"] and not location_map["url"]:
location_map = None

return {
"start_date": start_date,
"end_date": self.date_to_string(end),
Expand All @@ -158,6 +167,7 @@ def convert_ical_event(self, calendar_index, calendar_event: Event):
"url": calendar_event.get("URL"),
"id": uid + "-" + start_date.replace(" ", "-").replace(":", "-"),
"type": "event",
"categories": categories,
"color": calendar_event.color,
"categories": self.get_event_categories(calendar_event),
"css-classes": ["event"]
Expand Down
2 changes: 2 additions & 0 deletions open_web_calendar/templates/calendars/dhtmlx.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
{% if specification['menu_shows_description'] %}<div class="menu-text menu-calendar-description">{{ specification["description"] }}</div>{% endif %}
</div>
</div>
<div id="category-filters" style="margin-bottom: 15px;">
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add all the styles to the .css file?

</div>
<div id="scheduler_here" class="dhx_cal_container"
style='width:100%; height:100%;'>
<div class="dhx_cal_navline"></div>
Expand Down
8 changes: 8 additions & 0 deletions test_ics/diacritics.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:Café Meeting
DESCRIPTION:Résumé discussion
DTSTART:20250317T090000Z
DTEND:20250317T100000Z
END:VEVENT
END:VCALENDAR
Loading