11notes / docker-ics-view

Run open-web-calendar (web view for ics) based on Alpine Linux. Small, lightweight, secure and fast 🏔️
MIT License
9 stars 2 forks source link

Issue with appointments spanning over multiple Days #5

Closed BadWolf97 closed 1 year ago

BadWolf97 commented 1 year ago

I often have appointments that start at, lets say 8pm and end after midnight. The View turns them into an appointment spanning two whole days. Is there any way to fix this?

11notes commented 1 year ago

Can you try the newest version 1.13? I've just compiled it as of now. It's built on the newest version of https://github.com/niccokunzmann/open-web-calendar

BadWolf97 commented 1 year ago

Hello, with the tag "1.13" (sure, thats correct, I was on 1.4?) it doesn't work (no appointments visible) Also, there is an Error in the log:

11notes-ics-view-1  | [2023-06-19 10:48:03,328] ERROR in app: Exception on /calendar.events.json [GET]
11notes-ics-view-1  | Traceback (most recent call last):
11notes-ics-view-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
11notes-ics-view-1  |     response = self.full_dispatch_request()
11notes-ics-view-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11notes-ics-view-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
11notes-ics-view-1  |     rv = self.handle_user_exception(e)
11notes-ics-view-1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11notes-ics-view-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
11notes-ics-view-1  |     rv = self.dispatch_request()
11notes-ics-view-1  |          ^^^^^^^^^^^^^^^^^^^^^^^
11notes-ics-view-1  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
11notes-ics-view-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
11notes-ics-view-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11notes-ics-view-1  |   File "/ics/bin/app.py", line 174, in get_calendar
11notes-ics-view-1  |     strategy = ConvertToDhtmlx(specification, get_text_from_url)
11notes-ics-view-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11notes-ics-view-1  |   File "/ics/bin/conversion_base.py", line 30, in __init__
11notes-ics-view-1  |     self.created()
11notes-ics-view-1  |   File "/ics/bin/convert_to_dhtmlx.py", line 23, in created
11notes-ics-view-1  |     self.timezone = pytz.timezone(self.specification["timezone"])
11notes-ics-view-1  |                                   ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
11notes-ics-view-1  | KeyError: 'timezone'

This happens with the default as well as my settings.

11notes commented 1 year ago

I test my containers before deployment and I just tested again with:

docker run --rm -ti -p 5000:5000 11notes/ics-view:1.13

I get the default view withouth any errors. Are you sure you don't have a custom default.json? Since the last updated the original repo added a lof of new paramters and timezone is one of them, it has to be present in the .json either as empty "" or with a correct value. Can you show me your config.json (you can redact your ics).

BadWolf97 commented 1 year ago

Hello,

sorry, I had forgotten that I mounted /ics/etc, so I have had the old default.json. After fixing that, it works again, but the reported issue is still in effect.

Nico

11notes commented 1 year ago

I've located the "issue", it's a configuration you can set on dhtmlx scheduler, question is, how would you like to enable options? It's javascript, I could add for each "common" one an environment variable where you can set it via

-e ICS_VIEW_ENABLE_PLUGIN_ALL_TIMED=true

Would that be okay?

11notes commented 1 year ago
Added two environment variables: Parameter Value Default
ICS_VIEW_DHTMLX_ENABLE_PLUGINS Enabled DHTMLX plugins "agenda_view multisource quick_info tooltip readonly"
ICS_VIEW_DHTMLX_DISABLE_PLUGINS Disabled DHTMLX plugins ""

To enable your request simply run as:

docker run --name ics-view \
  -v .../etc:/ics/etc \
  -e ICS_VIEW_DHTMLX_ENABLE_PLUGINS="agenda_view multisource quick_info tooltip readonly all_timed" \
  -d 11notes/ics-view:[tag]

ALL_TIMED is the plugin you need plugin example

BadWolf97 commented 1 year ago

Hello, thanks for your help and the necessary updates, it works like a charm now :) Nico