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

Missing public holidays for Sweden #72

Closed
VorpalBlade opened this issue Feb 22, 2015 · 12 comments
Closed

Missing public holidays for Sweden #72

VorpalBlade opened this issue Feb 22, 2015 · 12 comments
Assignees
Labels
prio/low type: feature Introduction of new functionality.
Milestone

Comments

@VorpalBlade
Copy link

The tool told me the following when I was verifying a conditional maxspeed in Sweden:

An error occurred during evaluation of the value "PH". Please file a bug report here: https://github.com/ypid/opening_hours.js/issues?state=open. No holidays are defined for country se. You can also add them: https://github.com/ypid/opening_hours.js

The official law for public holidays is http://www.riksdagen.se/sv/Dokument-Lagar/Lagar/Svenskforfattningssamling/Lag-1989253-om-allmanna-hel_sfs-1989-253/ (in Swedish)

The English Wikipedia has the following page that may be of help (though it appears to be incomplete, it doesn't specify when Easter actually is for example): https://en.wikipedia.org/wiki/Public_holidays_in_Sweden

For that reason here is a translation of the law (I'm a native speaker):

1 § Public holiday means in law or other constitutional writing:

Sundays, including Easter day and Pentecost, New Year's Day, Epiphany, May Day, Christmas Day and Boxing Day, even when they do not fall on a Sunday,
Long Friday, Easter Monday, Ascension Day, National Day, Midsummer Day and All Saints Day.

Law (2004:1320)

2 § The in 1 § listed holidays occurs:

New Year's day           January 1
Epiphany                 January 6
Long Friday              The Friday preceding Easter Sunday
Easter day               Sunday immediately following the full moon
                         which falls on or immediately following March 21
Easter Monday            The day after Easter Sunday
Ascension                Sixth Thursday after Easter Sunday
Pentecost                The seventh Sunday after Easter Sunday
National Day             June 6
Midsummer Day            On Saturday that falls during the period
                         between June 20 and June 26
All Saints Day           On Saturday that falls during the period
                         between 31 October and November 6
Christmas Day            December 25
Boxing Day               26th December.

Law (2004:1320)
@ypid ypid added the type: feature Introduction of new functionality. label Feb 22, 2015
@ypid ypid added this to the v3.1.1 milestone Feb 22, 2015
@ypid
Copy link
Member

ypid commented Feb 22, 2015

Thanks very much for the translation. I will probably add them in release 3.1.1.

@VorpalBlade
Copy link
Author

Though looking at the relevant source file, I now see that you want the holiday names to use the localized values. Since the ordering of the entries matches, you could probably easily pick those from the Swedish law text though?

@ypid
Copy link
Member

ypid commented Feb 22, 2015

I guess localized holiday names make more sense. I will use the Swedish onces from the law text.

@ypid
Copy link
Member

ypid commented Feb 25, 2015

Swedish public holidays seem to have some special cases like "On Saturday that falls during the period between June 20 and June 26". Because of that, I would like to wait until #71 is closed before I will implement them.

@ypid ypid modified the milestones: v3.1.2, v3.1.1 Apr 12, 2015
@ypid ypid removed this from the v3.1.2 milestone May 16, 2015
@ypid
Copy link
Member

ypid commented Oct 22, 2015

Can you maybe submit a PR please? See https://github.com/ypid/opening_hours.js#holidays-1

@ypid
Copy link
Member

ypid commented Nov 27, 2015

This issue is not dependent on #71 anymore. PR are still welcome.

@ypid ypid added the prio/low label Nov 27, 2015
@ypid ypid added this to the Omnisciently milestone Nov 27, 2015
@VorpalBlade
Copy link
Author

Alas I'm not a JavaScript programmer, so a PR might not be a good idea. My day job is as an embedded real time systems C/C++ programmer.

@ypid ypid closed this as completed in 9d8d19a Jun 26, 2016
@ypid ypid modified the milestones: v3.5.0, world conquest Jun 26, 2016
@ypid ypid self-assigned this Jun 26, 2016
@ypid
Copy link
Member

ypid commented Jun 26, 2016

@VorpalBlade Thanks for your help!

ypid added a commit that referenced this issue Jun 27, 2016
@ypid
Copy link
Member

ypid commented Jun 27, 2016

@VorpalBlade Can you have a look if the definition is correct and works correctly? If all works as expected you can close this issue.

URL for testing: http://openingh.openstreetmap.de/evaluation_tool/?EXP=PH&DATE=1466965680000&lat=63&lon=16&mode=0/

PH for the next 4 years:

./PH_SH_exporter.js --verbose --from=2016 --to=2020 --public-holidays --country se --region _se /tmp/se_PH.txt
2016-01-01 nyårsdagen
2016-01-06 trettondedag jul
2016-03-25 långfredagen
2016-03-27 påskdagen
2016-03-28 annandag påsk
2016-05-01 första maj
2016-05-15 pingstdagen
2016-06-06 nationaldagen
2016-06-25 midsommardagen
2016-11-05 alla helgons dag
2016-12-25 juldagen
2016-12-26 annandag jul
2017-01-01 nyårsdagen
2017-01-06 trettondedag jul
2017-04-14 långfredagen
2017-04-16 påskdagen
2017-04-17 annandag påsk
2017-05-01 första maj
2017-06-04 pingstdagen
2017-06-06 nationaldagen
2017-06-24 midsommardagen
2017-11-04 alla helgons dag
2017-12-25 juldagen
2017-12-26 annandag jul
2018-01-01 nyårsdagen
2018-01-06 trettondedag jul
2018-03-30 långfredagen
2018-04-01 påskdagen
2018-04-02 annandag påsk
2018-05-01 första maj
2018-05-20 pingstdagen
2018-06-06 nationaldagen
2018-06-23 midsommardagen
2018-11-03 alla helgons dag
2018-12-25 juldagen
2018-12-26 annandag jul
2019-01-01 nyårsdagen
2019-01-06 trettondedag jul
2019-04-19 långfredagen
2019-04-21 påskdagen
2019-04-22 annandag påsk
2019-05-01 första maj
2019-06-06 nationaldagen
2019-06-09 pingstdagen
2019-06-22 midsommardagen
2019-11-02 alla helgons dag
2019-12-25 juldagen
2019-12-26 annandag jul
2020-01-01 nyårsdagen
2020-01-06 trettondedag jul
2020-04-10 långfredagen
2020-04-12 påskdagen
2020-04-13 annandag påsk
2020-05-01 första maj
2020-05-31 pingstdagen
2020-06-06 nationaldagen
2020-06-20 midsommardagen
2020-10-31 alla helgons dag
2020-12-25 juldagen
2020-12-26 annandag jul

@ypid ypid reopened this Jun 27, 2016
@ypid
Copy link
Member

ypid commented Sep 15, 2016

Closing. Feel free to comment.

@squeak9
Copy link

squeak9 commented Dec 5, 2024

Can this be opened again now that there's a pull request?

@ypid
Copy link
Member

ypid commented Dec 9, 2024

Opening this issue does not help and is against the policy that I have documented here: https://github.com/opening-hours/opening_hours.js?tab=readme-ov-file#holiday-data

I mainly need help in form of PR reviews and testing. See #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio/low type: feature Introduction of new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants