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

[ephemeris] Upgrade/replace Jollyday #3544

Closed
jlaur opened this issue Apr 12, 2023 · 6 comments · Fixed by #4033
Closed

[ephemeris] Upgrade/replace Jollyday #3544

jlaur opened this issue Apr 12, 2023 · 6 comments · Fixed by #4033
Labels
enhancement An enhancement or new feature of the Core

Comments

@jlaur
Copy link
Contributor

jlaur commented Apr 12, 2023

Jollyday used by Ephemeris seems abandoned years ago:
https://github.com/svendiedrichsen/jollyday

Fortunately the project was picked up and continued here:
https://github.com/focus-shift/jollyday

See svendiedrichsen/jollyday#72

This seems almost like a drop-in replacement.

Replacing the library would give several benefits, for example updated holidays for 70 countries that would be bundled with the distribution. The current situation is that users need to maintain national holidays by themselves. As an example, one of the Danish holidays has been eliminated, starting next year (GENERAL_PRAYER_DAY in the XML below). So if I understand this correctly, I must now create my own file:

/etc/openhab/services/Holidays_dk.xml:

<?xml version="1.0" encoding="UTF-8"?>
<tns:Configuration hierarchy="dk" description="Denmark"
        xmlns:tns="http://www.example.org/Holiday" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
        <tns:Holidays>
                <tns:Fixed month="JANUARY" day="1" descriptionPropertiesKey="NEW_YEAR" />
                <tns:Fixed month="DECEMBER" day="25"
                        descriptionPropertiesKey="CHRISTMAS" />
                <tns:Fixed month="DECEMBER" day="26"
                        descriptionPropertiesKey="STEPHENS" />
                <tns:ChristianHoliday type="EASTER" />
                <tns:ChristianHoliday type="MAUNDY_THURSDAY" />
                <tns:ChristianHoliday type="GOOD_FRIDAY" />
                <tns:ChristianHoliday type="EASTER_MONDAY" />
                <tns:ChristianHoliday type="GENERAL_PRAYER_DAY" validTo="2023" />
                <tns:ChristianHoliday type="ASCENSION_DAY" />
                <tns:ChristianHoliday type="WHIT_MONDAY" />
                <tns:ChristianHoliday type="PENTECOST" />
        </tns:Holidays>
</tns:Configuration>

and directly reference this file in all rules:

var dt1 = ZonedDateTime.of(2023, 5, 5, 0, 0, 0, 0, ZoneId.systemDefault())
var dt2 = ZonedDateTime.of(2024, 4, 26, 0, 0, 0, 0, ZoneId.systemDefault())
logInfo("Ephemeris", "Store Bededag 2023: " + Ephemeris.isBankHoliday(dt1, "/etc/openhab/services/Holidays_dk.xml").toString)
logInfo("Ephemeris", "Store Bededag 2024: " + Ephemeris.isBankHoliday(dt2, "/etc/openhab/services/Holidays_dk.xml").toString)
@jlaur jlaur added the enhancement An enhancement or new feature of the Core label Apr 12, 2023
@jlaur
Copy link
Contributor Author

jlaur commented Apr 21, 2023

Perhaps a first step could be to add support for bundling holiday configurations as resources that would then override those provided by Jollyday.

The obvious disadvantage is that we would then take over the maintenance. But on the other hand, they are not maintained anymore upstream, so at least it would improve the user experience. Additionally, it would not change the API, so upgrading to focus-shift later will be seamless for users.

I would rather update the Danish holidays once in this repository for everyone's benefit, rather than update it in my own installation for my own benefit (and hassle remembering to reference it from all rules calling Ephemeris actions).

WDYT?

@wborn
Copy link
Member

wborn commented Jul 31, 2023

Additionally, it would not change the API, so upgrading to focus-shift later will be seamless for users.

It's not an OSGi bundle because the code got removed for adding bundle manifest headers, see focus-shift/jollyday#254.

@jlaur
Copy link
Contributor Author

jlaur commented Jan 10, 2024

focus-shift/jollyday#253 was just merged, so perhaps this gives us a chance to upgrade.

@wborn
Copy link
Member

wborn commented Jan 10, 2024

Also saw that. 🙂 I can give it another try and see how well it works. I tried using the JAX-B implementation some time ago but couldn't easily get it to work.

@jlaur
Copy link
Contributor Author

jlaur commented Jan 10, 2024

I can give it another try and see how well it works.

That would be awesome - many thanks in advance. I guess we just have to await a new release first.

wborn added a commit to wborn/openhab-core that referenced this issue Jan 11, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.0 of a more actively maintained fork (de.focus-shift).

This adds many missing holidays.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
Copy link
Member

wborn commented Jan 11, 2024

It seems to work well after adding some missing bundle headers with focus-shift/jollyday#417. 😄

wborn added a commit to wborn/openhab-core that referenced this issue Jan 12, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.0 of a more actively maintained fork (de.focus-shift).

* This add many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
wborn added a commit to wborn/openhab-core that referenced this issue Jan 12, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.0 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
wborn added a commit to wborn/openhab-core that referenced this issue Jan 12, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.0 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
wborn added a commit to wborn/openhab-core that referenced this issue Jan 12, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.1 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
wborn added a commit to wborn/openhab-core that referenced this issue Jan 14, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
kaikreuzer pushed a commit that referenced this issue Jan 14, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by #3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes #3544

Signed-off-by: Wouter Born <github@maindrain.net>
cipianpascu pushed a commit to cipianpascu/openhab-core that referenced this issue Jan 17, 2024
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).

* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by openhab#3573.

For release notes, see:

https://github.com/focus-shift/jollyday/releases

Fixes openhab#3544

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
2 participants