Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different source colours or prefixes #52

Closed
fnetX opened this issue May 30, 2019 · 8 comments · Fixed by #306
Closed

different source colours or prefixes #52

fnetX opened this issue May 30, 2019 · 8 comments · Fixed by #306

Comments

@fnetX
Copy link

fnetX commented May 30, 2019

Hey,

When using multiple calendar sources, it might be a nice idea to specify keep them distinguishable, e.g. by using different (background / highlight) colours or prefixes for each of them.


We're using [Polar.sh](https://polar.sh/niccokunzmann) so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work. Fund with Polar
@niccokunzmann
Copy link
Owner

There seems to be an in official attribute for color: X-APPLE-CALENDAR-COLOR

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//SabreDAV//SabreDAV//EN
X-WR-CALNAME:chaostreff-potsdam
X-APPLE-CALENDAR-COLOR:#CACBCD
END:VCALENDAR

This seems to be used by nextcloud

@id-ic
Copy link

id-ic commented Oct 21, 2020

Pardon my ignorance but how would you add that?

@niccokunzmann
Copy link
Owner

Each event goes through Javascript. That could be the place. Also, the attribute might need to be copied over from the Python event object into the JSON data that is sent to the website by flask.

@goreavin
Copy link

goreavin commented Oct 1, 2021

@niccokunzmann : I have now added the above attribute but still no change in the calendar colors... Am I missing something?

CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:HCY
X-APPLE-CALENDAR-COLOR:#94e3a8
BEGIN:VEVENT
DTSTART:20210901T140000Z
DTEND:20210901T150000Z
CREATED:20211001T083933Z
DTSTAMP:20211001T084933Z
LAST-MODIFIED:20211001T084933Z

@barnabycollins
Copy link
Contributor

barnabycollins commented Mar 24, 2022

+1 for this. I'm working with Outlook calendars, and I don't think I can add colours to the calendars themselves, but I'd like to be able to distinguish between different calendars that have been imported into the view.

@barnabycollins
Copy link
Contributor

barnabycollins commented Mar 24, 2022

Going off the DHTMLX docs, and having had a quick nose through the codebase, am I right in thinking that adding the following line or similar to the return statement at /convert_to_dhtmlx.py:42 would at least get the background colour changing for coloured events?

"color": calendar_event.get("X-APPLE-CALENDAR-COLOR", ""),

Additionally, the below line might be needed:

"textColor": "#ffffff",

assuming that the calendar program has provided colours with high enough contrast from white.

@niccokunzmann
Copy link
Owner

niccokunzmann commented Mar 31, 2022 via email

@niccokunzmann
Copy link
Owner

As linked in the Pull Requests above, now you can change the color of the calendars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants