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

Easily add holidays #962

Closed
3 tasks done
Tracked by #66
ryanprior opened this issue Nov 27, 2018 · 29 comments · Fixed by nextcloud/documentation#10237
Closed
3 tasks done
Tracked by #66

Easily add holidays #962

ryanprior opened this issue Nov 27, 2018 · 29 comments · Fixed by nextcloud/documentation#10237
Assignees
Labels
3. to review Waiting for reviews enhancement New feature request META skill:backend Issues and PRs that require backend development skills skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills

Comments

@ryanprior
Copy link

ryanprior commented Nov 27, 2018

There ought to be an easy, obvious interface to add a standard holiday calendar to your NextCloud.

In nextcloud/server#1363 the request was made to "make national holidays available in calendar" and this was implemented by allowing webcal subscriptions. That technically works but it has these drawbacks:

  • NextCloud cedes control over the user experience to arbitrary third party holiday webcal providers, whose UX is atrocious
  • somebody who isn't familiar with webcal will not think to solve the problem this way
  • for people who know about webcal, it's still not trivial to find the right calendar out there on the internet
  • a webcal can send spam to users or otherwise abuse the relationship, and has little incentive not to do so since NextCloud offers no alternative

A way to resolve this is to provide a convenient interface for users to find a holiday calendar that's relevant to them and add it in a few clicks, without having to know about the implementation. Advantages of this approach:

  • NextCloud can ensure a good user experience
  • holiday calendars are discoverable and anyone can use them easily
  • basic calendar information like holidays are kept private, with no unnecessary reliance on third party data providers

Acceptance criteria

Work packages

Follow-ups

@georgehrke
Copy link
Member

I would really like to ship holiday calendars, but the biggest problem is: Where to get the data from?

It should be obvious that we can’t copy and paste the Google Holiday calendars for copyright reasons.

@ryanprior Are you aware of any database that offers holiday data under a free (foss) license?

@ryanprior
Copy link
Author

ryanprior commented Nov 27, 2018

Wikimedia Commons has your back, with holiday data covering the globe and dozens of cultures, all under Creative Commons Attribution-ShareAlike:

Just doing this research is making clear to me the enormity of this task. It seems like massaging all this into a query-friendly format would be an undertaking all by itself. Possibly if we reach out to Wikimedia they might know somebody who has already done this?

I'm also aware that libraries often have query-friendly databases that they share with people. I'll ask a librarian if they have further ideas and report back here.

Another thing worth pointing out is that this problem can be significantly collapsed: building holiday support for a few locales could cover most of NextCloud's user base and simultaneously lay the groundwork for global coverage once the appropriate comprehensive database is made available.

@tcitworld
Copy link
Member

So it's basically unusable until the data is filled into Wikidata or someone finds an existing tool to scrape it from Wikipedia. :/

@ryanprior
Copy link
Author

At least more usable than scraping from Google Calendar. I'm investigating to see if there's a convenient option that already exists.

@cbrace
Copy link

cbrace commented May 5, 2019

There is a large collection of national holiday calendars for Lightning on the Mozilla site. The ICS file can be dowloaded or added as an online calendar subscription. I have just downloaded and imported into Nextcloud the ICS holiday file for the Netherlands (contains holidays up to the year 2050), and this works fine.

Theoretically it might be preferable to have an "internal" Nextcloud solution, but why reinvent the wheel?

https://www.thunderbird.net/en-US/calendar/holidays/

@tcitworld
Copy link
Member

tcitworld commented May 5, 2019

Thanks for the link!

The issue is that there's no way to link to a specific ICS file from the information we have (language, locale). So there's multiple options:

  • Either only provide a link to this page and tell people to pick the subscription they want, which would be a good start.
  • Either build a 3rd-party service that does the matching between the locale and the country.

Moreover these calendars don't seem to have school holiday informations (at least for France) and specific public holidays for some regions.

@cbrace
Copy link

cbrace commented May 6, 2019

I probably should have emphasized that this is a rather crude workaround until something better can be arranged.

Regarding school vacations, I appreciate that might be useful info, but seems to me it belongs in a separate calendar from national holidays.

Also, I don't know how they are planned in France, but here in NL the start and end dates are now staggered geographically and rotated every year to reduce congestion. It might not be possible to "program" such a calendar very far in the future, at least in this particular case.

It might be an idea to alert the Thunderbird/Lightning team to the fact that these calendars are useful for other applications as well, and look into creating some kind of simple interface for retrieving them.

@ryanprior
Copy link
Author

Incremental steps in this direction are a good idea. In order of fanciness, we could:

  1. write a help page about how to use WebCal + this Mozilla list to add holidays
  2. add an option in the UI that links to that help page
  3. autodetect the locale and offer to import the appropriate calendar in the UI
  4. create a NextCloud-native solution, perhaps using the Mozilla data as a backend, perhaps not

Each one of those steps that we take brings an incrementally better experience for our users. This is an area where our interests are aligned with the Mozilla Lightning folks and we should take advantage of that in any way we can, whether that means linking to them, consuming their webcal feeds automatically, or using the same backing data in our own native approach. Reaching out to them seems like a good idea- @cbrace will you open a line of communication and link to the discussion here so people can follow?

@cbrace
Copy link

cbrace commented May 7, 2019

Done! I posted here: https://discourse.mozilla.org/t/holiday-calendars-useful-resource/39993

In an earlier life I worked as a technical writer, and I would be happy to lend a hand with a help page, if pointed in the right direction.

@georgehrke
Copy link
Member

@cbrace That would be really great!

Contributing to our documentation is really easy. Just fork our documentation repo, edit this rst file and send a pull request. Once it's merged, our online documentation will automatically be updated within minutes.

@cbrace
Copy link

cbrace commented May 7, 2019

@georgehrke Done!

This is my first pull request on Github, so I hope I did it correctly.

One thing I wasn't sure about is whether importing calendars from file is available for all users, or whether it can be disabled by an admin.

I believe it is possible to subscribe to the calendars published on the thunderbird site rather than downloading and importing. I could test this and add it if people think it is a good idea. (I prefer to import myself)

@georgehrke
Copy link
Member

Resource from KDE: https://cgit.kde.org/kholidays.git/tree/holidays/plan2
NPM lib to generate date of easter: https://www.npmjs.com/package/@pacote/computus

The source from KDE seems more reliable than Mozilla.

Ideally this should be implemented as an individual app registering its own calendars.
Let's keep this open for tracking the progress.

@georgehrke georgehrke added enhancement New feature request META and removed enhancement-proposed labels Sep 13, 2019
@georgehrke
Copy link
Member

For reference: nextcloud/server#17126

@nadimattari
Copy link

nadimattari commented Sep 26, 2019

On KHolidays, I maintain the holidays for Mauritius (https://github.com/KDE/kholidays/blob/master/holidays/plan2/holiday_mu_en). How can I help to maintain the same here, if any?

@ryanprior
Copy link
Author

Hi @nadimattari, thanks for volunteering to help maintain Nextcloud! @georgehrke is working on an addition to the Nextcloud framework that will allow applications to add dates to the calendar. Then we can create a Nextcloud app, perhaps based on the KDE calendar data, which can handle holidays.

So if you're interested in getting involved with Nextcloud development, you could start building an app which assumes some as-yet-unspecified API for exposing calendar events, and pulls data from KDE repositories to do so.

We could also use help finding or creating documentation for how to easily make use of KDE's holiday data without using the KDE framework, for example using PHP.

Thanks again, we're glad to have you here!

@georgehrke georgehrke added this to the Maybe some day milestone Mar 3, 2020
@tcitworld

This comment has been minimized.

@tcitworld
Copy link
Member

For those interested in this issue, I wanted to mention I created an app allowing to subscribe easily to various public holidays: https://apps.nextcloud.com/apps/holiday_calendars

@tcitworld tcitworld removed their assignment Oct 3, 2022
@tcitworld tcitworld removed this from To do in Thomas things to do Oct 3, 2022
@ChristophWurst ChristophWurst added 1. to develop Accepted and waiting to be taken care of skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills skill:backend Issues and PRs that require backend development skills labels Apr 4, 2023
@miaulalala miaulalala assigned miaulalala and unassigned miaulalala Apr 4, 2023
@jjasoncool
Copy link

jjasoncool commented Apr 7, 2023

For those interested in this issue, I wanted to mention I created an app allowing to subscribe easily to various public holidays: https://apps.nextcloud.com/apps/holiday_calendars

Can this app add custom link (e.g. google calendar ics) and share to some member?

The default function in calendar add subscribe by link only for myself, I can't share the calendar to another person.

nextcloud/server#1600

Thank you.

@ChristophWurst
Copy link
Member

@tcitworld fyi we are planning to work on this and add a shortcut to Calendar to add subscriptions from https://www.thunderbird.net/en-US/calendar/holidays easily

@ChristophWurst ChristophWurst self-assigned this Apr 27, 2023
@ChristophWurst ChristophWurst added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Apr 27, 2023
@ChristophWurst
Copy link
Member

Bildschirmfoto vom 2023-04-27 12-52-48

^ @nimishavijay @jancborchardt for design feedback. If there are bigger changes please provide us with a mockup :)

@nimishavijay
Copy link
Member

nimishavijay commented Apr 27, 2023

Super nice! That looks great! :) No super major points of feedback, only some adjustments with spacing and formatting:

  • "Holiday Calendars" --> "Holiday calendars", use sentence case
  • "Add holiday subscriptions" --> "Add holiday calendar" in the action menu
  • For each calendar:
    • Use bold text for the country to make scanning through easier
    • Use --color-main-text for the first subline, also slight change in wording "Date range: startyear - endyear" --> "startyear to endyear"
    • Reduce the space below the country so that it looks similar to a list item

It could look like this:

image

2 nice-to-have follow up enhancements:

  • If you have subscribed to a calendar, sort that up top
  • Add a search field to find your preferred calendar quickly

@tcitworld
Copy link
Member

tcitworld commented Apr 27, 2023

I'd also add a bottom line crediting Thunderbird as the source and explaining the calendar will be downloaded from their servers.

@nimishavijay
Copy link
Member

@tcitworld agreed, nice catch! It can be a subline below the heading in --color-maxcontrast :)

@ChristophWurst
Copy link
Member

ChristophWurst commented Apr 27, 2023

@tcitworld do you recall the magic behind https://framagit.org/framasoft/nextcloud/holiday_calendars/-/blob/66873b114e3dbc42429a5e08fe9eba721d1b5382/src/services/caldavService.js#L83? In Calendar all subscriptions are found as calendars and they have no source property. I need the prop to disable the subscribe button for existing subscriptions. ✌️

It's strange how everything ends up in calendars for Calendar using https://github.com/nextcloud/cdav-library/blob/3cf672021e94c52428095775f301812f75a8f397/src/models/calendarHome.js#L88 and your app finding subscriptions with sources with https://github.com/nextcloud/cdav-library/blob/3cf672021e94c52428095775f301812f75a8f397/src/models/calendarHome.js#L120 🤯

@ChristophWurst
Copy link
Member

I noticed you're using 'X-NC-CalDAV-Webcal-Caching': 'Off',

@ChristophWurst
Copy link
Member

ChristophWurst commented Apr 28, 2023

I'm unable to get unsubscribe handling working. The calendar app fetches subscriptions as calendars. To detect already subscribed holiday calendars we have to fetch subscriptions separately. Mapping that together and keeping it in sync with new or removed subscriptions is not trivial. I'll save that for a follow-up ticket. For now a user can use the modal to subscribe to a holiday calendar. To unsubscribe they have to use the Delete action in the navigation. I say that is good enough.

Edit: created #5168

@tcitworld
Copy link
Member

tcitworld commented Apr 28, 2023

That's right, only subscriptions expose the source property.

Would it be so bothering to refetch subscriptions (as such, with Webcal-Caching off) when opening the holiday modal?
Otherwise we can fetch the source property for calendars as well, but that's an overhead. Still, it would also allow copying the source URI from the subscription, which I remember people asking about, but can't find an issue for.

@ChristophWurst
Copy link
Member

Would it be so bothering to refetch subscriptions (as such, with Webcal-Caching off) when opening the holiday modal?
Otherwise we can fetch the source property for calendars as well, but that's an overhead. Still, it would also allow copying the source URI from the subscription, which I remember people asking about, but can't find an issue for.

We'll have a look when working on #5168!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature request META skill:backend Issues and PRs that require backend development skills skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

9 participants