Compare commits
No commits in common. "master" and "1.0.1" have entirely different histories.
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,6 +1,3 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.gem
|
*.gem
|
||||||
nbproject
|
nbproject
|
||||||
doc/
|
|
||||||
rdoc/
|
|
||||||
Gemfile.lock
|
|
|
@ -1,8 +0,0 @@
|
||||||
notifications:
|
|
||||||
disabled: true
|
|
||||||
rvm:
|
|
||||||
- 1.8.7
|
|
||||||
- 1.9.2
|
|
||||||
- 1.9.3
|
|
||||||
- jruby
|
|
||||||
- ree
|
|
|
@ -1,14 +1,5 @@
|
||||||
= Ruby Holidays Gem CHANGELOG
|
= Ruby Holidays Gem CHANGELOG
|
||||||
|
|
||||||
== 1.0.4
|
|
||||||
* Add Liechtenstein holiday defs (mercy vielmal Bernhard Furtmueller)
|
|
||||||
|
|
||||||
== 1.0.3
|
|
||||||
* Add Austrian holiday definitions (thanks to Vogel Siegfried)
|
|
||||||
|
|
||||||
== 1.0.2
|
|
||||||
* Add `orthodox_easter` method and Greek holiday definitions (thanks https://github.com/ddimitriadis)
|
|
||||||
|
|
||||||
== 1.0.0
|
== 1.0.0
|
||||||
* Support calculating mday from negative weeks other than -1 (thanks http://github.com/bjeanes)
|
* Support calculating mday from negative weeks other than -1 (thanks http://github.com/bjeanes)
|
||||||
* Use class method to check leap years and fixed bug in Date.calculate_mday
|
* Use class method to check leap years and fixed bug in Date.calculate_mday
|
||||||
|
|
8
Gemfile
8
Gemfile
|
@ -1,8 +0,0 @@
|
||||||
source "http://rubygems.org"
|
|
||||||
|
|
||||||
gemspec
|
|
||||||
|
|
||||||
group :test, :development do
|
|
||||||
gem 'rake'
|
|
||||||
gem 'rdoc', '>= 2.4.2'
|
|
||||||
end
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
==== Ruby Holidays Gem License
|
==== Ruby Holidays Gem License
|
||||||
|
|
||||||
Copyright (c) 2007-11 Alex Dunae
|
Copyright (c) 2007-08 Alex Dunae
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -68,6 +68,6 @@ Lookup Canada Day in different regions.
|
||||||
* Docs: http://rdoc.info/github/alexdunae/holidays/master/frames
|
* Docs: http://rdoc.info/github/alexdunae/holidays/master/frames
|
||||||
* Contributors: https://github.com/alexdunae/holidays/contributors
|
* Contributors: https://github.com/alexdunae/holidays/contributors
|
||||||
|
|
||||||
Started by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-11.
|
Started by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-10.
|
||||||
|
|
||||||
Made on Vancouver Island.
|
Made on Vancouver Island.
|
||||||
|
|
68
data/at.yaml
68
data/at.yaml
|
@ -1,68 +0,0 @@
|
||||||
# Austrian holiday definitions for the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Updated: 2011-08-31 by VGSG
|
|
||||||
# Sources:
|
|
||||||
# - http://de.wikipedia.org/wiki/Feiertage_in_%C3%96sterreich
|
|
||||||
# - http://www.timeanddate.com/calendar/index.html?country=8
|
|
||||||
# - http://www.germany.info/relaunch/welcome/travel/holidays.html
|
|
||||||
---
|
|
||||||
months:
|
|
||||||
0:
|
|
||||||
- name: Ostermontag
|
|
||||||
regions: [at]
|
|
||||||
function: easter(year)+1
|
|
||||||
- name: Christi Himmelfahrt
|
|
||||||
regions: [at]
|
|
||||||
function: easter(year)+39
|
|
||||||
- name: Pfingstmontag
|
|
||||||
regions: [at]
|
|
||||||
function: easter(year)+50
|
|
||||||
- name: Fronleichnam
|
|
||||||
regions: [at]
|
|
||||||
function: easter(year)+60
|
|
||||||
1:
|
|
||||||
- name: Neujahrstag
|
|
||||||
regions: [at]
|
|
||||||
mday: 1
|
|
||||||
- name: Heilige Drei Könige
|
|
||||||
regions: [at]
|
|
||||||
mday: 6
|
|
||||||
5:
|
|
||||||
- name: Staatsfeiertag
|
|
||||||
regions: [at]
|
|
||||||
mday: 1
|
|
||||||
8:
|
|
||||||
- name: Mariä Himmelfahrt
|
|
||||||
regions: [at]
|
|
||||||
mday: 15
|
|
||||||
10:
|
|
||||||
- name: Nationalfeiertag
|
|
||||||
regions: [at]
|
|
||||||
mday: 26
|
|
||||||
11:
|
|
||||||
- name: Allerheiligen
|
|
||||||
regions: [at]
|
|
||||||
mday: 1
|
|
||||||
12:
|
|
||||||
- name: Mariä Empfägnis
|
|
||||||
regions: [at]
|
|
||||||
mday: 8
|
|
||||||
- name: 1. Weihnachtstag
|
|
||||||
regions: [at]
|
|
||||||
mday: 25
|
|
||||||
- name: 2. Weihnachtstag
|
|
||||||
regions: [at]
|
|
||||||
mday: 26
|
|
||||||
tests: |
|
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,1) => 'Staatsfeiertag',
|
|
||||||
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,10,26) => 'Nationalfeiertag',
|
|
||||||
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
|
||||||
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :at, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
assert !Date.civil(2010,5,8).holiday?(:at), '2010-05-08 is not a holiday in Austria'
|
|
|
@ -104,33 +104,29 @@ def parse_holiday_defs(module_name, files)
|
||||||
module_src =<<-EOM
|
module_src =<<-EOM
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: #{files.join(', ')}
|
# Definitions loaded: #{files.join(', ')}
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/#{module_name.downcase}'
|
# require 'holidays/#{module_name.downcase}'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module #{module_name} # :nodoc:
|
module #{module_name} # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:#{regions.flatten.uniq.join(', :')}]
|
||||||
[:#{regions.flatten.uniq.join(', :')}]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
#{month_strs.join(",\n")}
|
#{month_strs.join(",\n")}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
#{method_str}
|
#{method_str}
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::#{module_name}.defined_regions, Holidays::#{module_name}.holidays_by_month)
|
Holidays.merge_defs(Holidays::#{module_name}::DEFINED_REGIONS, Holidays::#{module_name}::HOLIDAYS_BY_MONTH)
|
||||||
EOM
|
EOM
|
||||||
|
|
||||||
|
|
||||||
|
|
79
data/el.yaml
79
data/el.yaml
|
@ -1,79 +0,0 @@
|
||||||
# Greek holiday definitions for the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Created: 2011-05-11.
|
|
||||||
# Sources:
|
|
||||||
# http://www.assa.org.au/edm.html
|
|
||||||
# http://fotios.org/node/1104
|
|
||||||
# http://www.faqs.org/faqs/calendars/faq/
|
|
||||||
# http://5dspace-time.org/Calendar/Algorithm.html - for offsets
|
|
||||||
# http://el.wikipedia.org/wiki/Επίσημες_αργίες_στην_Ελλάδα - for holidays
|
|
||||||
# http://www.eortologio.gr/arthra/pasxa.php - for holidays
|
|
||||||
---
|
|
||||||
months:
|
|
||||||
0:
|
|
||||||
- name: Μεγάλη Παρασκευή
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)-2
|
|
||||||
- name: Μεγάλο Σάββατο
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)-1
|
|
||||||
- name: Κυριακή του Πάσχα
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)
|
|
||||||
- name: Δευτέρα του Πάσχα
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)+1
|
|
||||||
- name: Καθαρά Δευτέρα
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)-48
|
|
||||||
- name: Αγίου Πνεύματος
|
|
||||||
regions: [el]
|
|
||||||
function: orthodox_easter(year)+50
|
|
||||||
1:
|
|
||||||
- name: Πρωτοχρονιά
|
|
||||||
regions: [el]
|
|
||||||
mday: 1
|
|
||||||
- name: Θεοφάνεια
|
|
||||||
regions: [el]
|
|
||||||
mday: 6
|
|
||||||
3:
|
|
||||||
- name: Επέτειος της Επανάστασης του 1821
|
|
||||||
regions: [el]
|
|
||||||
mday: 25
|
|
||||||
5:
|
|
||||||
- name: Πρωτομαγιά
|
|
||||||
regions: [el]
|
|
||||||
mday: 1
|
|
||||||
8:
|
|
||||||
- name: Κοίμηση της Θεοτόκου
|
|
||||||
regions: [el]
|
|
||||||
mday: 15
|
|
||||||
10:
|
|
||||||
- name: Επέτειος του Όχι
|
|
||||||
regions: [el]
|
|
||||||
mday: 28
|
|
||||||
12:
|
|
||||||
- name: Χριστούγεννα
|
|
||||||
regions: [el]
|
|
||||||
mday: 25
|
|
||||||
- name: Δεύτερη ημέρα των Χριστουγέννων
|
|
||||||
regions: [el]
|
|
||||||
mday: 26
|
|
||||||
tests: |
|
|
||||||
{Date.civil(2011,1,1) => 'Πρωτοχρονιά',
|
|
||||||
Date.civil(2011,1,6) => 'Θεοφάνεια',
|
|
||||||
Date.civil(2011,4,22) => 'Μεγάλη Παρασκευή',
|
|
||||||
Date.civil(1970,4,25) => 'Μεγάλο Σάββατο',
|
|
||||||
Date.civil(1985,4,14) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2011,4,24) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2027,5,2) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2046,4,30) => 'Δευτέρα του Πάσχα',
|
|
||||||
Date.civil(2011,5,1) => 'Πρωτομαγιά',
|
|
||||||
Date.civil(2011,6,13) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2012,6,4) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2011,3,7) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2012,2,27) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2011,12,25) => 'Χριστούγεννα',
|
|
||||||
Date.civil(2011,12,26) => 'Δεύτερη ημέρα των Χριστουγέννων'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :el, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
|
@ -1,14 +1,12 @@
|
||||||
# Definition build list
|
# Definition build list
|
||||||
---
|
---
|
||||||
defs:
|
defs:
|
||||||
AT: ['at.yaml']
|
|
||||||
AU: ['au.yaml']
|
AU: ['au.yaml']
|
||||||
BR: ['br.yaml']
|
BR: ['br.yaml']
|
||||||
CA: ['ca.yaml', 'north_america_informal.yaml']
|
CA: ['ca.yaml', 'north_america_informal.yaml']
|
||||||
CZ: ['cz.yaml']
|
CZ: ['cz.yaml']
|
||||||
DK: ['dk.yaml']
|
DK: ['dk.yaml']
|
||||||
DE: ['de.yaml']
|
DE: ['de.yaml']
|
||||||
EL: ['el.yaml']
|
|
||||||
ES: ['es.yaml']
|
ES: ['es.yaml']
|
||||||
FI: ['fi.yaml']
|
FI: ['fi.yaml']
|
||||||
FR: ['fr.yaml']
|
FR: ['fr.yaml']
|
||||||
|
@ -16,13 +14,11 @@ defs:
|
||||||
IE: ['ie.yaml']
|
IE: ['ie.yaml']
|
||||||
IS: ['is.yaml']
|
IS: ['is.yaml']
|
||||||
IT: ['it.yaml']
|
IT: ['it.yaml']
|
||||||
LI: ['li.yaml']
|
|
||||||
MX: ['mx.yaml', 'north_america_informal.yaml']
|
MX: ['mx.yaml', 'north_america_informal.yaml']
|
||||||
NL: ['nl.yaml']
|
NL: ['nl.yaml']
|
||||||
"NO": ['no.yaml']
|
"NO": ['no.yaml']
|
||||||
NYSE: ['nyse.yaml']
|
NYSE: ['nyse.yaml']
|
||||||
NZ: ['nz.yaml']
|
NZ: ['nz.yaml']
|
||||||
PL: ['pl.yaml']
|
|
||||||
PT: ['pt.yaml']
|
PT: ['pt.yaml']
|
||||||
SE: ['se.yaml']
|
SE: ['se.yaml']
|
||||||
US: ['us.yaml', 'north_america_informal.yaml']
|
US: ['us.yaml', 'north_america_informal.yaml']
|
||||||
|
@ -31,5 +27,5 @@ defs:
|
||||||
ZA: ['za.yaml']
|
ZA: ['za.yaml']
|
||||||
North_America: ['ca.yaml', 'mx.yaml', 'us.yaml', 'north_america_informal.yaml']
|
North_America: ['ca.yaml', 'mx.yaml', 'us.yaml', 'north_america_informal.yaml']
|
||||||
Scandinavia: ['dk.yaml', 'is.yaml', 'no.yaml', 'se.yaml', 'fi.yaml']
|
Scandinavia: ['dk.yaml', 'is.yaml', 'no.yaml', 'se.yaml', 'fi.yaml']
|
||||||
Europe: ['at.yaml', 'cz.yaml', 'dk.yaml', 'de.yaml', 'el.yaml', 'es.yaml', 'fr.yaml', 'gb.yaml', 'ie.yaml', 'is.yaml', 'it.yaml', 'li.yaml', 'nl.yaml', 'no.yaml', 'pl.yaml', 'pt.yaml']
|
Europe: ['cz.yaml', 'dk.yaml', 'de.yaml', 'es.yaml', 'fr.yaml', 'gb.yaml', 'ie.yaml', 'is.yaml', 'it.yaml', 'nl.yaml', 'no.yaml', 'pt.yaml']
|
||||||
JP: ['jp.yaml']
|
JP: ['jp.yaml']
|
||||||
|
|
102
data/li.yaml
102
data/li.yaml
|
@ -1,102 +0,0 @@
|
||||||
# Liechtenstein holiday definitions for the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Updated: 2011-10-17.
|
|
||||||
# Sources:
|
|
||||||
# http://www.tourismus.li/de/navpage-RegionLI-InformationLI-44728.html
|
|
||||||
---
|
|
||||||
months:
|
|
||||||
0:
|
|
||||||
- name: Fasnachtsdienstag
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)-47
|
|
||||||
- name: Karfreitag
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)-2
|
|
||||||
- name: Ostern
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)
|
|
||||||
type: informal
|
|
||||||
- name: Ostermontag
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)+1
|
|
||||||
- name: Auffahrt
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)+39
|
|
||||||
- name: Pfingstmontag
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)+50
|
|
||||||
- name: Fronleichnam
|
|
||||||
regions: [li]
|
|
||||||
function: easter(year)+60
|
|
||||||
1:
|
|
||||||
- name: Neujahrstag
|
|
||||||
regions: [li]
|
|
||||||
mday: 1
|
|
||||||
- name: Heilige Drei Könige
|
|
||||||
regions: [li, li]
|
|
||||||
mday: 6
|
|
||||||
2:
|
|
||||||
- name: Maria Lichtmess
|
|
||||||
regions: [li]
|
|
||||||
mday: 2
|
|
||||||
3:
|
|
||||||
- name: St. Josef
|
|
||||||
regions: [li]
|
|
||||||
mday: 19
|
|
||||||
5:
|
|
||||||
- name: Tag der Arbeit
|
|
||||||
regions: [li]
|
|
||||||
mday: 1
|
|
||||||
8:
|
|
||||||
- name: Staatsfeiertag
|
|
||||||
regions: [li]
|
|
||||||
mday: 15
|
|
||||||
9:
|
|
||||||
- name: Maria Geburt
|
|
||||||
regions: [li]
|
|
||||||
mday: 8
|
|
||||||
11:
|
|
||||||
- name: Allerheiligen
|
|
||||||
regions: [li]
|
|
||||||
mday: 1
|
|
||||||
12:
|
|
||||||
- name: Maria Empfängnis
|
|
||||||
regions: [li]
|
|
||||||
mday: 8
|
|
||||||
- name: Heilig Abend
|
|
||||||
regions: [li]
|
|
||||||
mday: 24
|
|
||||||
- name: Weihnachten
|
|
||||||
regions: [li]
|
|
||||||
mday: 25
|
|
||||||
- name: Stefanstag
|
|
||||||
regions: [li]
|
|
||||||
mday: 26
|
|
||||||
- name: Silvester
|
|
||||||
regions: [li]
|
|
||||||
mday: 31
|
|
||||||
tests: |
|
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2011,3,8) => 'Fasnachtsdienstag',
|
|
||||||
Date.civil(2009,4,10) => 'Karfreitag',
|
|
||||||
Date.civil(2009,4,12) => 'Ostern',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,21) => 'Auffahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,12,25) => 'Weihnachten',
|
|
||||||
Date.civil(2009,12,26) => 'Stefanstag'}.each do |date, name|
|
|
||||||
assert_equal name, Holidays.on(date, :li, :informal)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Staatsfeiertag', Date.civil(2009,8,15).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
310
data/pl.yaml
310
data/pl.yaml
|
@ -1,310 +0,0 @@
|
||||||
# Poland holiday definitions for the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Updated: 2011-09-12.
|
|
||||||
# Source: http://pl.wikipedia.org/wiki/Dni_wolne_od_pracy_w_Polsce
|
|
||||||
---
|
|
||||||
months:
|
|
||||||
0:
|
|
||||||
- name: Tłusty Czwartek
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-52
|
|
||||||
type: informal
|
|
||||||
- name: Ostatki
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-47
|
|
||||||
type: informal
|
|
||||||
- name: Środa Popielcowa
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-46
|
|
||||||
type: informal
|
|
||||||
- name: Niedziela Palmowa
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-7
|
|
||||||
type: informal
|
|
||||||
- name: Wielki Czwartek
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-3
|
|
||||||
type: informal
|
|
||||||
- name: Wielki Piątek
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-2
|
|
||||||
type: informal
|
|
||||||
- name: Wielka Sobota
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)-1
|
|
||||||
type: informal
|
|
||||||
- name: Niedziela Wielkanocna
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)
|
|
||||||
- name: Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)+1
|
|
||||||
- name: Zesłanie Ducha Świętego (Zielone Świątki)
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)+49
|
|
||||||
- name: Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
||||||
regions: [pl]
|
|
||||||
function: easter(year)+60
|
|
||||||
1:
|
|
||||||
- name: Nowy Rok
|
|
||||||
regions: [pl]
|
|
||||||
mday: 1
|
|
||||||
- name: Objawienie Pańskie (święto Trzech Króli)
|
|
||||||
regions: [pl]
|
|
||||||
function: pl_trzech_kroli(year)
|
|
||||||
- name: Objawienie Pańskie (święto Trzech Króli)
|
|
||||||
regions: [pl]
|
|
||||||
function: pl_trzech_kroli_informal(year)
|
|
||||||
type: informal
|
|
||||||
- name: Dzień Babci
|
|
||||||
regions: [pl]
|
|
||||||
mday: 21
|
|
||||||
type: informal
|
|
||||||
- name: Dzień Dziadka
|
|
||||||
regions: [pl]
|
|
||||||
mday: 22
|
|
||||||
type: informal
|
|
||||||
2:
|
|
||||||
- name: Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)
|
|
||||||
regions: [pl]
|
|
||||||
mday: 2
|
|
||||||
type: informal
|
|
||||||
- name: Dzień Zakochanych (Walentynki)
|
|
||||||
regions: [pl]
|
|
||||||
mday: 14
|
|
||||||
type: informal
|
|
||||||
3:
|
|
||||||
- name: Dzień Kobiet
|
|
||||||
regions: [pl]
|
|
||||||
mday: 8
|
|
||||||
type: informal
|
|
||||||
- name: Dzień Mężczyzn
|
|
||||||
regions: [pl]
|
|
||||||
mday: 10
|
|
||||||
type: informal
|
|
||||||
4:
|
|
||||||
- name: Prima Aprilis
|
|
||||||
regions: [pl]
|
|
||||||
mday: 1
|
|
||||||
type: informal
|
|
||||||
- name: Międzynarodowy Dzień Ziemi
|
|
||||||
regions: [pl]
|
|
||||||
mday: 22
|
|
||||||
type: informal
|
|
||||||
5:
|
|
||||||
- name: Święto Państwowe (Święto Pracy)
|
|
||||||
regions: [pl]
|
|
||||||
mday: 1
|
|
||||||
- name: Dzień Flagi Rzeczpospolitej Polskiej
|
|
||||||
regions: [pl]
|
|
||||||
mday: 2
|
|
||||||
type: informal
|
|
||||||
- name: Święto Narodowe Trzeciego Maja
|
|
||||||
regions: [pl]
|
|
||||||
mday: 3
|
|
||||||
6:
|
|
||||||
- name: Dzień Ojca
|
|
||||||
regions: [pl]
|
|
||||||
mday: 23
|
|
||||||
type: informal
|
|
||||||
8:
|
|
||||||
- name: Wniebowzięcie Najświętszej Maryi Panny
|
|
||||||
regions: [pl]
|
|
||||||
mday: 15
|
|
||||||
- name: Święto Wojska Polskiego
|
|
||||||
regions: [pl]
|
|
||||||
mday: 15
|
|
||||||
9:
|
|
||||||
- name: Dzień Chłopaka
|
|
||||||
regions: [pl]
|
|
||||||
mday: 30
|
|
||||||
type: informal
|
|
||||||
10:
|
|
||||||
- name: Dzień Nauczyciela (Dzień Edukacji Narodowej)
|
|
||||||
regions: [pl]
|
|
||||||
mday: 14
|
|
||||||
type: informal
|
|
||||||
11:
|
|
||||||
- name: Wszystkich Świętych
|
|
||||||
regions: [pl]
|
|
||||||
mday: 1
|
|
||||||
- name: Dzień Zaduszny
|
|
||||||
regions: [pl]
|
|
||||||
mday: 2
|
|
||||||
type: informal
|
|
||||||
- name: Narodowe Święto Niepodległości
|
|
||||||
regions: [pl]
|
|
||||||
mday: 11
|
|
||||||
- name: Andrzejki
|
|
||||||
regions: [pl]
|
|
||||||
mday: 29
|
|
||||||
type: informal
|
|
||||||
12:
|
|
||||||
- name: Barbórka (Dzień Górnika, Naftowca i Gazownika)
|
|
||||||
regions: [pl]
|
|
||||||
mday: 4
|
|
||||||
type: informal
|
|
||||||
- name: Mikołajki
|
|
||||||
regions: [pl]
|
|
||||||
mday: 6
|
|
||||||
type: informal
|
|
||||||
- name: Wigilia Bożego Narodzenia
|
|
||||||
regions: [pl]
|
|
||||||
mday: 24
|
|
||||||
type: informal
|
|
||||||
- name: pierwszy dzień Bożego Narodzenia
|
|
||||||
regions: [pl]
|
|
||||||
mday: 25
|
|
||||||
- name: drugi dzień Bożego Narodzenia
|
|
||||||
regions: [pl]
|
|
||||||
mday: 26
|
|
||||||
- name: Sylwester
|
|
||||||
regions: [pl]
|
|
||||||
mday: 31
|
|
||||||
type: informal
|
|
||||||
methods:
|
|
||||||
pl_trzech_kroli: |
|
|
||||||
# Poland: January 6 is holiday since 2011
|
|
||||||
def self.pl_trzech_kroli(year)
|
|
||||||
year >= 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
pl_trzech_kroli_informal: |
|
|
||||||
# Poland: January 6 wasn't holiday before 2011
|
|
||||||
def self.pl_trzech_kroli_informal(year)
|
|
||||||
year < 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
tests: |
|
|
||||||
{Date.civil(2011,1,1) => 'Nowy Rok',
|
|
||||||
Date.civil(2011,5,1) => 'Święto Państwowe (Święto Pracy)',
|
|
||||||
Date.civil(2011,5,3) => 'Święto Narodowe Trzeciego Maja',
|
|
||||||
Date.civil(2011,11,1) => 'Wszystkich Świętych',
|
|
||||||
Date.civil(2011,11,11) => 'Narodowe Święto Niepodległości',
|
|
||||||
Date.civil(2011,12,25) => 'pierwszy dzień Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,26) => 'drugi dzień Bożego Narodzenia'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Objawienie Pańskie (święto Trzech Króli) -- formal since 2011
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2011,1,6), Date.civil(2012,1,6), Date.civil(2013,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Tłusty Czwartek
|
|
||||||
[Date.civil(2008,1,31), Date.civil(2009,2,19), Date.civil(2010,2,11),
|
|
||||||
Date.civil(2011,3,3), Date.civil(2012,2,16)].each do |date|
|
|
||||||
assert_equal 'Tłusty Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Ostatki
|
|
||||||
[Date.civil(2008,2,5), Date.civil(2009,2,24), Date.civil(2010,2,16),
|
|
||||||
Date.civil(2011,3,8), Date.civil(2012,2,21)].each do |date|
|
|
||||||
assert_equal 'Ostatki', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Środa Popielcowa
|
|
||||||
[Date.civil(2008,2,6), Date.civil(2009,2,25), Date.civil(2010,2,17),
|
|
||||||
Date.civil(2011,3,9), Date.civil(2012,2,22)].each do |date|
|
|
||||||
assert_equal 'Środa Popielcowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Palmowa
|
|
||||||
[Date.civil(2008,3,16), Date.civil(2009,4,5), Date.civil(2010,3,28),
|
|
||||||
Date.civil(2011,4,17), Date.civil(2012,4,1)].each do |date|
|
|
||||||
assert_equal 'Niedziela Palmowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Czwartek
|
|
||||||
[Date.civil(2008,3,20), Date.civil(2009,4,9), Date.civil(2010,4,1),
|
|
||||||
Date.civil(2011,4,21), Date.civil(2012,4,5)].each do |date|
|
|
||||||
assert_equal 'Wielki Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Piątek
|
|
||||||
[Date.civil(2008,3,21), Date.civil(2009,4,10), Date.civil(2010,4,2),
|
|
||||||
Date.civil(2011,4,22), Date.civil(2012,4,6)].each do |date|
|
|
||||||
assert_equal 'Wielki Piątek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielka Sobota
|
|
||||||
[Date.civil(2008,3,22), Date.civil(2009,4,11), Date.civil(2010,4,3),
|
|
||||||
Date.civil(2011,4,23), Date.civil(2012,4,7)].each do |date|
|
|
||||||
assert_equal 'Wielka Sobota', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Wielkanocna
|
|
||||||
[Date.civil(2008,3,23), Date.civil(2009,4,12), Date.civil(2010,4,4),
|
|
||||||
Date.civil(2011,4,24), Date.civil(2012,4,8)].each do |date|
|
|
||||||
assert_equal 'Niedziela Wielkanocna', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
||||||
[Date.civil(2008,3,24), Date.civil(2009,4,13), Date.civil(2010,4,5),
|
|
||||||
Date.civil(2011,4,25), Date.civil(2012,4,9)].each do |date|
|
|
||||||
assert_equal 'Poniedziałek Wielkanocny (Lany Poniedziałek)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Zesłanie Ducha Świętego (Zielone Świątki)
|
|
||||||
[Date.civil(2008,5,11), Date.civil(2009,5,31), Date.civil(2010,5,23),
|
|
||||||
Date.civil(2011,6,12), Date.civil(2012,5,27)].each do |date|
|
|
||||||
assert_equal 'Zesłanie Ducha Świętego (Zielone Świątki)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
||||||
[Date.civil(2008,5,22), Date.civil(2009,6,11), Date.civil(2010,6,3),
|
|
||||||
Date.civil(2011,6,23), Date.civil(2012,6,7)].each do |date|
|
|
||||||
assert_equal 'Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wniebowzięcie Najświętszej Maryi Panny & Święto Wojska Polskiego
|
|
||||||
assert_equal 'Wniebowzięcie Najświętszej Maryi Panny', (Holidays.on(Date.civil(2011,8,15), :pl)[0] || {})[:name]
|
|
||||||
assert_equal 'Święto Wojska Polskiego', (Holidays.on(Date.civil(2011,8,15), :pl)[1] || {})[:name]
|
|
|
@ -1,189 +1,188 @@
|
||||||
# United Nationas holiday definitions for the Ruby Holiday gem.
|
# United Nationas holiday definitions for the Ruby Holiday gem.
|
||||||
# Updated 2008-11-21.
|
# Updated 2008-11-21.
|
||||||
---
|
---
|
||||||
months:
|
|
||||||
2:
|
2:
|
||||||
- name: International Mother Language Day
|
- name: International Mother Language Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 2
|
mday: 2
|
||||||
3:
|
3:
|
||||||
- name: United Nations Day for Women's Rights and International Peace
|
- name: United Nations Day for Women's Rights and International Peace
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 8
|
mday: 8
|
||||||
- name: International Day for the Elimination of Racial Discrimination
|
- name: International Day for the Elimination of Racial Discrimination
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 21
|
mday: 21
|
||||||
- name: Beginning of the Week of Solidarity with the Peoples Struggling against Racism and Racial Discrimination
|
- name: Beginning of the Week of Solidarity with the Peoples Struggling against Racism and Racial Discrimination
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 21
|
mday: 21
|
||||||
- name: World Day for Water
|
- name: World Day for Water
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 22
|
mday: 22
|
||||||
- name: World Meteorological Day
|
- name: World Meteorological Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 23
|
mday: 23
|
||||||
4:
|
4:
|
||||||
- name: World Health Day
|
- name: World Health Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 7
|
mday: 7
|
||||||
- name: World Book and Copyright Day
|
- name: World Book and Copyright Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 23
|
mday: 23
|
||||||
5:
|
5:
|
||||||
- name: World Press Freedom Day
|
- name: World Press Freedom Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 3
|
mday: 3
|
||||||
- name: International Day of Families
|
- name: International Day of Families
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 15
|
mday: 15
|
||||||
- name: World Telecommunication Day
|
- name: World Telecommunication Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 17
|
mday: 17
|
||||||
- name: World Day for Cultural Diversity for Dialogue and Development
|
- name: World Day for Cultural Diversity for Dialogue and Development
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 21
|
mday: 21
|
||||||
- name: International Day for Biological Diversity
|
- name: International Day for Biological Diversity
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 22
|
mday: 22
|
||||||
- name: Beginning of the Week of Solidarity with the Peoples of Non-Self-Governing Territories
|
- name: Beginning of the Week of Solidarity with the Peoples of Non-Self-Governing Territories
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 25
|
mday: 25
|
||||||
- name: International Day of United Nations Peacekeepers
|
- name: International Day of United Nations Peacekeepers
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 29
|
mday: 29
|
||||||
- name: World No-Tobacco Day
|
- name: World No-Tobacco Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 31
|
mday: 31
|
||||||
6:
|
6:
|
||||||
- name: International Day of Innocent Children Victims of Aggression
|
- name: International Day of Innocent Children Victims of Aggression
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 4
|
mday: 4
|
||||||
- name: World Environment Day
|
- name: World Environment Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 5
|
mday: 5
|
||||||
- name: World Day to Combat Desertification and Drought
|
- name: World Day to Combat Desertification and Drought
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 17
|
mday: 17
|
||||||
- name: World Refugee Day
|
- name: World Refugee Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 20
|
mday: 20
|
||||||
- name: United Nations Public Service Day
|
- name: United Nations Public Service Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 23
|
mday: 23
|
||||||
- name: International Day against Drug Abuse and Illicit Trafficking
|
- name: International Day against Drug Abuse and Illicit Trafficking
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 26
|
mday: 26
|
||||||
- name: International Day in Support of Victims of Torture
|
- name: International Day in Support of Victims of Torture
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 26
|
mday: 26
|
||||||
7:
|
7:
|
||||||
- name: International Day of Cooperatives
|
- name: International Day of Cooperatives
|
||||||
week: 1
|
week: 1
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
wday: 6
|
wday: 6
|
||||||
- name: World Population Day
|
- name: World Population Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 11
|
mday: 11
|
||||||
8:
|
8:
|
||||||
- name: International Day of the World's Indigenous People
|
- name: International Day of the World's Indigenous People
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 9
|
mday: 9
|
||||||
- name: International Youth Day
|
- name: International Youth Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 12
|
mday: 12
|
||||||
- name: International Day for the Remembrance of the Slave Trade and Its Abolition
|
- name: International Day for the Remembrance of the Slave Trade and Its Abolition
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 23
|
mday: 23
|
||||||
9:
|
9:
|
||||||
- name: International Literacy Day
|
- name: International Literacy Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 8
|
mday: 8
|
||||||
- name: International Day for the Preservation of the Ozone Layer
|
- name: International Day for the Preservation of the Ozone Layer
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 16
|
mday: 16
|
||||||
- name: International Day of Peace
|
- name: International Day of Peace
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 21
|
mday: 21
|
||||||
- name: International Day of Older Persons
|
- name: International Day of Older Persons
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 1
|
mday: 1
|
||||||
10:
|
10:
|
||||||
- name: World Space Week
|
- name: World Space Week
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 4
|
mday: 4
|
||||||
- name: World Teachers' Day
|
- name: World Teachers' Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 5
|
mday: 5
|
||||||
- name: World Habitat Day
|
- name: World Habitat Day
|
||||||
week: 1
|
week: 1
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
wday: 1
|
wday: 1
|
||||||
- name: International Day for Natural Disaster Reduction
|
- name: International Day for Natural Disaster Reduction
|
||||||
week: 2
|
week: 2
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
wday: 3
|
wday: 3
|
||||||
- name: World Post Day
|
- name: World Post Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 9
|
mday: 9
|
||||||
- name: World Mental Health Day
|
- name: World Mental Health Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 10
|
mday: 10
|
||||||
- name: World Food Day
|
- name: World Food Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 16
|
mday: 16
|
||||||
- name: International Day for the Eradication of Poverty
|
- name: International Day for the Eradication of Poverty
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 17
|
mday: 17
|
||||||
- name: United Nations Day
|
- name: United Nations Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 24
|
mday: 24
|
||||||
- name: World Development Information Day
|
- name: World Development Information Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 24
|
mday: 24
|
||||||
- name: Disarmament Week
|
- name: Disarmament Week
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 24
|
mday: 24
|
||||||
11:
|
11:
|
||||||
- name: International Day for Preventing the Exploitation of the Environment in War and Armed Conflict
|
- name: International Day for Preventing the Exploitation of the Environment in War and Armed Conflict
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 6
|
mday: 6
|
||||||
- name: International Day for Tolerance
|
- name: International Day for Tolerance
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 16
|
mday: 16
|
||||||
- name: Africa Industrialization Day
|
- name: Africa Industrialization Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 20
|
mday: 20
|
||||||
- name: Universal Children's Day
|
- name: Universal Children's Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 20
|
mday: 20
|
||||||
- name: World Television Day
|
- name: World Television Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 21
|
mday: 21
|
||||||
- name: International Day for the Elimination of Violence against Women
|
- name: International Day for the Elimination of Violence against Women
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 25
|
mday: 25
|
||||||
- name: International Day of Solidarity with the Palestinian People
|
- name: International Day of Solidarity with the Palestinian People
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 29
|
mday: 29
|
||||||
12:
|
12:
|
||||||
- name: World AIDS Day
|
- name: World AIDS Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 1
|
mday: 1
|
||||||
- name: International Day for the Abolition of Slavery
|
- name: International Day for the Abolition of Slavery
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 2
|
mday: 2
|
||||||
- name: International Day of Disabled Persons
|
- name: International Day of Disabled Persons
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 3
|
mday: 3
|
||||||
- name: International Volunteer Day for Economic and Social Development
|
- name: International Volunteer Day for Economic and Social Development
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 5
|
mday: 5
|
||||||
- name: International Civil Aviation Day
|
- name: International Civil Aviation Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 7
|
mday: 7
|
||||||
- name: Human Rights Day
|
- name: Human Rights Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 10
|
mday: 10
|
||||||
- name: International Migrants Day
|
- name: International Migrants Day
|
||||||
regions: [united_nations]
|
regions: [un]
|
||||||
mday: 18
|
mday: 18
|
||||||
|
|
109
holidays.gemspec
109
holidays.gemspec
|
@ -4,27 +4,24 @@
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "holidays"
|
s.name = %q{holidays}
|
||||||
s.version = "1.0.4"
|
s.version = "1.0.1"
|
||||||
|
|
||||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Alex Dunae"]
|
s.authors = ["Alex Dunae", "Rowan Crawford"]
|
||||||
s.date = "2011-10-19"
|
s.date = %q{2011-04-29}
|
||||||
s.description = "A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!"
|
s.description = %q{A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!}
|
||||||
s.email = "code@dunae.ca"
|
s.email = %q{code@dunae.ca}
|
||||||
s.extra_rdoc_files = [
|
s.extra_rdoc_files = [
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"README.rdoc"
|
"README.rdoc"
|
||||||
]
|
]
|
||||||
s.files = [
|
s.files = [
|
||||||
".travis.yml",
|
|
||||||
"CHANGELOG",
|
"CHANGELOG",
|
||||||
"Gemfile",
|
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"README.rdoc",
|
"README.rdoc",
|
||||||
"REFERENCES",
|
"REFERENCES",
|
||||||
"data/SYNTAX.rdoc",
|
"data/SYNTAX.rdoc",
|
||||||
"data/at.yaml",
|
|
||||||
"data/au.yaml",
|
"data/au.yaml",
|
||||||
"data/br.yaml",
|
"data/br.yaml",
|
||||||
"data/build_defs.rb",
|
"data/build_defs.rb",
|
||||||
|
@ -32,7 +29,6 @@ Gem::Specification.new do |s|
|
||||||
"data/cz.yaml",
|
"data/cz.yaml",
|
||||||
"data/de.yaml",
|
"data/de.yaml",
|
||||||
"data/dk.yaml",
|
"data/dk.yaml",
|
||||||
"data/el.yaml",
|
|
||||||
"data/es.yaml",
|
"data/es.yaml",
|
||||||
"data/fi.yaml",
|
"data/fi.yaml",
|
||||||
"data/fr.yaml",
|
"data/fr.yaml",
|
||||||
|
@ -42,14 +38,12 @@ Gem::Specification.new do |s|
|
||||||
"data/is.yaml",
|
"data/is.yaml",
|
||||||
"data/it.yaml",
|
"data/it.yaml",
|
||||||
"data/jp.yaml",
|
"data/jp.yaml",
|
||||||
"data/li.yaml",
|
|
||||||
"data/mx.yaml",
|
"data/mx.yaml",
|
||||||
"data/nl.yaml",
|
"data/nl.yaml",
|
||||||
"data/no.yaml",
|
"data/no.yaml",
|
||||||
"data/north_america_informal.yaml",
|
"data/north_america_informal.yaml",
|
||||||
"data/nyse.yaml",
|
"data/nyse.yaml",
|
||||||
"data/nz.yaml",
|
"data/nz.yaml",
|
||||||
"data/pl.yaml",
|
|
||||||
"data/pt.yaml",
|
"data/pt.yaml",
|
||||||
"data/se.yaml",
|
"data/se.yaml",
|
||||||
"data/united_nations.yaml",
|
"data/united_nations.yaml",
|
||||||
|
@ -59,14 +53,12 @@ Gem::Specification.new do |s|
|
||||||
"holidays.gemspec",
|
"holidays.gemspec",
|
||||||
"lib/holidays.rb",
|
"lib/holidays.rb",
|
||||||
"lib/holidays/MANIFEST",
|
"lib/holidays/MANIFEST",
|
||||||
"lib/holidays/at.rb",
|
|
||||||
"lib/holidays/au.rb",
|
"lib/holidays/au.rb",
|
||||||
"lib/holidays/br.rb",
|
"lib/holidays/br.rb",
|
||||||
"lib/holidays/ca.rb",
|
"lib/holidays/ca.rb",
|
||||||
"lib/holidays/cz.rb",
|
"lib/holidays/cz.rb",
|
||||||
"lib/holidays/de.rb",
|
"lib/holidays/de.rb",
|
||||||
"lib/holidays/dk.rb",
|
"lib/holidays/dk.rb",
|
||||||
"lib/holidays/el.rb",
|
|
||||||
"lib/holidays/es.rb",
|
"lib/holidays/es.rb",
|
||||||
"lib/holidays/europe.rb",
|
"lib/holidays/europe.rb",
|
||||||
"lib/holidays/fi.rb",
|
"lib/holidays/fi.rb",
|
||||||
|
@ -76,14 +68,12 @@ Gem::Specification.new do |s|
|
||||||
"lib/holidays/is.rb",
|
"lib/holidays/is.rb",
|
||||||
"lib/holidays/it.rb",
|
"lib/holidays/it.rb",
|
||||||
"lib/holidays/jp.rb",
|
"lib/holidays/jp.rb",
|
||||||
"lib/holidays/li.rb",
|
|
||||||
"lib/holidays/mx.rb",
|
"lib/holidays/mx.rb",
|
||||||
"lib/holidays/nl.rb",
|
"lib/holidays/nl.rb",
|
||||||
"lib/holidays/no.rb",
|
"lib/holidays/no.rb",
|
||||||
"lib/holidays/north_america.rb",
|
"lib/holidays/north_america.rb",
|
||||||
"lib/holidays/nyse.rb",
|
"lib/holidays/nyse.rb",
|
||||||
"lib/holidays/nz.rb",
|
"lib/holidays/nz.rb",
|
||||||
"lib/holidays/pl.rb",
|
|
||||||
"lib/holidays/pt.rb",
|
"lib/holidays/pt.rb",
|
||||||
"lib/holidays/scandinavia.rb",
|
"lib/holidays/scandinavia.rb",
|
||||||
"lib/holidays/se.rb",
|
"lib/holidays/se.rb",
|
||||||
|
@ -92,14 +82,12 @@ Gem::Specification.new do |s|
|
||||||
"lib/holidays/us.rb",
|
"lib/holidays/us.rb",
|
||||||
"lib/holidays/za.rb",
|
"lib/holidays/za.rb",
|
||||||
"rakefile.rb",
|
"rakefile.rb",
|
||||||
"test/defs/test_defs_at.rb",
|
|
||||||
"test/defs/test_defs_au.rb",
|
"test/defs/test_defs_au.rb",
|
||||||
"test/defs/test_defs_br.rb",
|
"test/defs/test_defs_br.rb",
|
||||||
"test/defs/test_defs_ca.rb",
|
"test/defs/test_defs_ca.rb",
|
||||||
"test/defs/test_defs_cz.rb",
|
"test/defs/test_defs_cz.rb",
|
||||||
"test/defs/test_defs_de.rb",
|
"test/defs/test_defs_de.rb",
|
||||||
"test/defs/test_defs_dk.rb",
|
"test/defs/test_defs_dk.rb",
|
||||||
"test/defs/test_defs_el.rb",
|
|
||||||
"test/defs/test_defs_es.rb",
|
"test/defs/test_defs_es.rb",
|
||||||
"test/defs/test_defs_europe.rb",
|
"test/defs/test_defs_europe.rb",
|
||||||
"test/defs/test_defs_fi.rb",
|
"test/defs/test_defs_fi.rb",
|
||||||
|
@ -109,80 +97,69 @@ Gem::Specification.new do |s|
|
||||||
"test/defs/test_defs_is.rb",
|
"test/defs/test_defs_is.rb",
|
||||||
"test/defs/test_defs_it.rb",
|
"test/defs/test_defs_it.rb",
|
||||||
"test/defs/test_defs_jp.rb",
|
"test/defs/test_defs_jp.rb",
|
||||||
"test/defs/test_defs_li.rb",
|
|
||||||
"test/defs/test_defs_mx.rb",
|
"test/defs/test_defs_mx.rb",
|
||||||
"test/defs/test_defs_nl.rb",
|
"test/defs/test_defs_nl.rb",
|
||||||
"test/defs/test_defs_no.rb",
|
"test/defs/test_defs_no.rb",
|
||||||
"test/defs/test_defs_north_america.rb",
|
"test/defs/test_defs_north_america.rb",
|
||||||
"test/defs/test_defs_nyse.rb",
|
"test/defs/test_defs_nyse.rb",
|
||||||
"test/defs/test_defs_nz.rb",
|
"test/defs/test_defs_nz.rb",
|
||||||
"test/defs/test_defs_pl.rb",
|
|
||||||
"test/defs/test_defs_pt.rb",
|
"test/defs/test_defs_pt.rb",
|
||||||
"test/defs/test_defs_scandinavia.rb",
|
"test/defs/test_defs_scandinavia.rb",
|
||||||
"test/defs/test_defs_se.rb",
|
"test/defs/test_defs_se.rb",
|
||||||
"test/defs/test_defs_ups.rb",
|
"test/defs/test_defs_ups.rb",
|
||||||
"test/defs/test_defs_us.rb",
|
"test/defs/test_defs_us.rb",
|
||||||
"test/defs/test_defs_za.rb",
|
"test/defs/test_defs_za.rb",
|
||||||
"test/test_all_regions.rb",
|
|
||||||
"test/test_date.rb",
|
"test/test_date.rb",
|
||||||
"test/test_helper.rb",
|
"test/test_helper.rb",
|
||||||
"test/test_holidays.rb",
|
"test/test_holidays.rb",
|
||||||
"test/test_multiple_regions.rb"
|
"test/test_multiple_regions.rb"
|
||||||
]
|
]
|
||||||
s.homepage = "https://github.com/alexdunae/holidays"
|
s.homepage = %q{https://github.com/alexdunae/holidays}
|
||||||
s.require_paths = ["lib"]
|
s.require_paths = ["lib"]
|
||||||
s.rubygems_version = "1.8.10"
|
s.rubygems_version = %q{1.3.7}
|
||||||
s.summary = "A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!"
|
s.summary = %q{A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!}
|
||||||
|
s.test_files = [
|
||||||
|
"test/defs/test_defs_au.rb",
|
||||||
|
"test/defs/test_defs_br.rb",
|
||||||
|
"test/defs/test_defs_ca.rb",
|
||||||
|
"test/defs/test_defs_cz.rb",
|
||||||
|
"test/defs/test_defs_de.rb",
|
||||||
|
"test/defs/test_defs_dk.rb",
|
||||||
|
"test/defs/test_defs_es.rb",
|
||||||
|
"test/defs/test_defs_europe.rb",
|
||||||
|
"test/defs/test_defs_fi.rb",
|
||||||
|
"test/defs/test_defs_fr.rb",
|
||||||
|
"test/defs/test_defs_gb.rb",
|
||||||
|
"test/defs/test_defs_ie.rb",
|
||||||
|
"test/defs/test_defs_is.rb",
|
||||||
|
"test/defs/test_defs_it.rb",
|
||||||
|
"test/defs/test_defs_jp.rb",
|
||||||
|
"test/defs/test_defs_mx.rb",
|
||||||
|
"test/defs/test_defs_nl.rb",
|
||||||
|
"test/defs/test_defs_no.rb",
|
||||||
|
"test/defs/test_defs_north_america.rb",
|
||||||
|
"test/defs/test_defs_nyse.rb",
|
||||||
|
"test/defs/test_defs_nz.rb",
|
||||||
|
"test/defs/test_defs_pt.rb",
|
||||||
|
"test/defs/test_defs_scandinavia.rb",
|
||||||
|
"test/defs/test_defs_se.rb",
|
||||||
|
"test/defs/test_defs_ups.rb",
|
||||||
|
"test/defs/test_defs_us.rb",
|
||||||
|
"test/defs/test_defs_za.rb",
|
||||||
|
"test/test_date.rb",
|
||||||
|
"test/test_helper.rb",
|
||||||
|
"test/test_holidays.rb",
|
||||||
|
"test/test_multiple_regions.rb"
|
||||||
|
]
|
||||||
|
|
||||||
if s.respond_to? :specification_version then
|
if s.respond_to? :specification_version then
|
||||||
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||||
s.specification_version = 3
|
s.specification_version = 3
|
||||||
|
|
||||||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
||||||
s.add_runtime_dependency(%q<holidays>, [">= 0"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
else
|
else
|
||||||
s.add_dependency(%q<holidays>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
s.add_dependency(%q<holidays>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rake>, [">= 0"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@ require 'date'
|
||||||
# [<tt>:any</tt>]
|
# [<tt>:any</tt>]
|
||||||
# Any region. Return holidays from any loaded region.
|
# Any region. Return holidays from any loaded region.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# You can load all the available holiday definition sets by running
|
|
||||||
# Holidays.load_all
|
|
||||||
# == Other options
|
# == Other options
|
||||||
# [<tt>:observed</tt>] Return holidays on the day they are observed (e.g. on a Monday if they fall on a Sunday).
|
# [<tt>:observed</tt>] Return holidays on the day they are observed (e.g. on a Monday if they fall on a Sunday).
|
||||||
# [<tt>:informal</tt>] Include informal holidays (e.g. Valentine's Day)
|
# [<tt>:informal</tt>] Include informal holidays (e.g. Valentine's Day)
|
||||||
|
@ -46,7 +43,7 @@ module Holidays
|
||||||
# Exception thrown when an unknown region is requested.
|
# Exception thrown when an unknown region is requested.
|
||||||
class UnknownRegionError < ArgumentError; end
|
class UnknownRegionError < ArgumentError; end
|
||||||
|
|
||||||
VERSION = '1.0.4'
|
VERSION = '1.0.1'
|
||||||
|
|
||||||
@@regions = []
|
@@regions = []
|
||||||
@@holidays_by_month = {}
|
@@holidays_by_month = {}
|
||||||
|
@ -55,7 +52,6 @@ module Holidays
|
||||||
WEEKS = {:first => 1, :second => 2, :third => 3, :fourth => 4, :fifth => 5, :last => -1, :second_last => -2, :third_last => -3}
|
WEEKS = {:first => 1, :second => 2, :third => 3, :fourth => 4, :fifth => 5, :last => -1, :second_last => -2, :third_last => -3}
|
||||||
MONTH_LENGTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
MONTH_LENGTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
||||||
DAY_SYMBOLS = Date::DAYNAMES.collect { |n| n.downcase.intern }
|
DAY_SYMBOLS = Date::DAYNAMES.collect { |n| n.downcase.intern }
|
||||||
DEFINITION_PATH = File.expand_path(File.dirname(__FILE__) + '/holidays/')
|
|
||||||
|
|
||||||
# Get all holidays on a given date.
|
# Get all holidays on a given date.
|
||||||
#
|
#
|
||||||
|
@ -216,33 +212,6 @@ module Holidays
|
||||||
Date.civil(year, month, day)
|
Date.civil(year, month, day)
|
||||||
end
|
end
|
||||||
|
|
||||||
# A method to calculate the orthodox easter date, returns date in the Gregorian (western) calendar
|
|
||||||
# Safe until appr. 4100 AD, when one leap day will be removed.
|
|
||||||
# Returns a Date object.
|
|
||||||
def self.orthodox_easter(year)
|
|
||||||
y = year
|
|
||||||
g = y % 19
|
|
||||||
i = (19 * g + 15) % 30
|
|
||||||
j = (year + year/4 + i) % 7
|
|
||||||
j_month = 3 + (i - j + 40) / 44
|
|
||||||
j_day = i - j + 28 - 31 * (j_month / 4)
|
|
||||||
j_date = Date.civil(year, j_month, j_day)
|
|
||||||
case
|
|
||||||
# up until 1582, julian and gregorian easter dates were identical
|
|
||||||
when year <= 1582
|
|
||||||
offset = 0
|
|
||||||
# between the years 1583 and 1699 10 days are added to the julian day count
|
|
||||||
when (year >= 1583 and year <= 1699)
|
|
||||||
offset = 10
|
|
||||||
# after 1700, 1 day is added for each century, except if the century year is exactly divisible by 400 (in which case no days are added).
|
|
||||||
# Safe until 4100 AD, when one leap day will be removed.
|
|
||||||
when year >= 1700
|
|
||||||
offset = (year - 1700).divmod(100)[0] + ((year - year.divmod(100)[1]).divmod(400)[1] == 0 ? 0 : 1) - (year - year.divmod(100)[1] - 1700).divmod(400)[0] + 10
|
|
||||||
end
|
|
||||||
# add offset to the julian day
|
|
||||||
return Date.jd(j_date.jd + offset)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Move date to Monday if it occurs on a Sunday.
|
# Move date to Monday if it occurs on a Sunday.
|
||||||
# Used as a callback function.
|
# Used as a callback function.
|
||||||
def self.to_monday_if_sunday(date)
|
def self.to_monday_if_sunday(date)
|
||||||
|
@ -274,19 +243,6 @@ module Holidays
|
||||||
date
|
date
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns an array of symbols all the available holiday definitions.
|
|
||||||
#
|
|
||||||
# Optional `full_path` param is used internally for loading all the definitions.
|
|
||||||
def self.available(full_path = false)
|
|
||||||
paths = Dir.glob(DEFINITION_PATH + '/*.rb')
|
|
||||||
full_path ? paths : paths.collect { |path| path.match(/([a-z_-]+)\.rb/i)[1].to_sym }
|
|
||||||
end
|
|
||||||
|
|
||||||
# Load all available holiday definitions
|
|
||||||
def self.load_all
|
|
||||||
self.available(true).each { |path| require path }
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
# Returns [(arr)regions, (bool)observed, (bool)informal]
|
# Returns [(arr)regions, (bool)observed, (bool)informal]
|
||||||
def self.parse_options(*options) # :nodoc:
|
def self.parse_options(*options) # :nodoc:
|
||||||
|
|
|
@ -1,34 +1,31 @@
|
||||||
==== Regional definitions
|
==== Regional definitions
|
||||||
The following definition files are included in this installation:
|
The following definition files are included in this installation:
|
||||||
|
|
||||||
* holidays/mx
|
|
||||||
* holidays/at
|
|
||||||
* holidays/nz
|
|
||||||
* holidays/nl
|
|
||||||
* holidays/dk
|
|
||||||
* holidays/cz
|
|
||||||
* holidays/scandinavia
|
|
||||||
* holidays/no
|
|
||||||
* holidays/pt
|
|
||||||
* holidays/nyse
|
|
||||||
* holidays/it
|
|
||||||
* holidays/united_nations
|
|
||||||
* holidays/au
|
* holidays/au
|
||||||
* holidays/us
|
|
||||||
* holidays/ie
|
|
||||||
* holidays/za
|
|
||||||
* holidays/is
|
|
||||||
* holidays/north_america
|
|
||||||
* holidays/es
|
|
||||||
* holidays/fi
|
|
||||||
* holidays/el
|
|
||||||
* holidays/europe
|
|
||||||
* holidays/de
|
|
||||||
* holidays/gb
|
|
||||||
* holidays/ups
|
|
||||||
* holidays/jp
|
|
||||||
* holidays/fr
|
|
||||||
* holidays/se
|
|
||||||
* holidays/ca
|
|
||||||
* holidays/br
|
* holidays/br
|
||||||
* holidays/pl
|
* holidays/ca
|
||||||
|
* holidays/cz
|
||||||
|
* holidays/de
|
||||||
|
* holidays/dk
|
||||||
|
* holidays/es
|
||||||
|
* holidays/europe
|
||||||
|
* holidays/fi
|
||||||
|
* holidays/fr
|
||||||
|
* holidays/gb
|
||||||
|
* holidays/ie
|
||||||
|
* holidays/is
|
||||||
|
* holidays/it
|
||||||
|
* holidays/jp
|
||||||
|
* holidays/mx
|
||||||
|
* holidays/nl
|
||||||
|
* holidays/no
|
||||||
|
* holidays/north_america
|
||||||
|
* holidays/nyse
|
||||||
|
* holidays/nz
|
||||||
|
* holidays/pt
|
||||||
|
* holidays/scandinavia
|
||||||
|
* holidays/se
|
||||||
|
* holidays/united_nations
|
||||||
|
* holidays/ups
|
||||||
|
* holidays/us
|
||||||
|
* holidays/za
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
module Holidays
|
|
||||||
# This file is generated by the Ruby Holidays gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/at.yaml
|
|
||||||
#
|
|
||||||
# To use the definitions in this file, load it right after you load the
|
|
||||||
# Holiday gem:
|
|
||||||
#
|
|
||||||
# require 'holidays'
|
|
||||||
# require 'holidays/at'
|
|
||||||
#
|
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
|
||||||
module AT # :nodoc:
|
|
||||||
def self.defined_regions
|
|
||||||
[:at]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:at]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:at]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:at]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:at]}],
|
|
||||||
1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:at]},
|
|
||||||
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:at]}],
|
|
||||||
5 => [{:mday => 1, :name => "Staatsfeiertag", :regions => [:at]}],
|
|
||||||
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:at]}],
|
|
||||||
10 => [{:mday => 26, :name => "Nationalfeiertag", :regions => [:at]}],
|
|
||||||
11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:at]}],
|
|
||||||
12 => [{:mday => 8, :name => "Mariä Empfängnis", :regions => [:at]},
|
|
||||||
{:mday => 25, :name => "1. Weihnachtstag", :regions => [:at]},
|
|
||||||
{:mday => 26, :name => "2. Weihnachtstag", :regions => [:at]}]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::AT.defined_regions, Holidays::AT.holidays_by_month)
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/au.yaml
|
# Definitions loaded: data/au.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/au'
|
# require 'holidays/au'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module AU # :nodoc:
|
module AU # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:au, :au_tas, :au_wa, :au_vic, :au_qld, :au_nt, :au_act, :au_nsw, :au_sa, :au_qld_brisbane]
|
||||||
[:au, :au_tas, :au_wa, :au_vic, :au_qld, :au_nt, :au_act, :au_nsw, :au_sa, :au_qld_brisbane]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:au]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:au]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au]},
|
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:au]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:au]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:au]},
|
||||||
|
@ -39,9 +36,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "Boxing Day", :regions => [:au]}]
|
{:mday => 26, :name => "Boxing Day", :regions => [:au]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::AU.defined_regions, Holidays::AU.holidays_by_month)
|
Holidays.merge_defs(Holidays::AU::DEFINED_REGIONS, Holidays::AU::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/br.yaml
|
# Definitions loaded: data/br.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/br'
|
# require 'holidays/br'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module BR # :nodoc:
|
module BR # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:br]
|
||||||
[:br]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:br]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:br]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:br]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:br]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:br]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:br]},
|
||||||
|
@ -32,9 +29,8 @@ module Holidays
|
||||||
12 => [{:mday => 25, :name => "Natal", :regions => [:br]}]
|
12 => [{:mday => 25, :name => "Natal", :regions => [:br]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::BR.defined_regions, Holidays::BR.holidays_by_month)
|
Holidays.merge_defs(Holidays::BR::DEFINED_REGIONS, Holidays::BR::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
|
# Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/ca'
|
# require 'holidays/ca'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module CA # :nodoc:
|
module CA # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_nf, :ca_nt, :ca_nu, :ca_bc, :ca_ns, :ca_yk, :us]
|
||||||
[:ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_nf, :ca_nt, :ca_nu, :ca_bc, :ca_ns, :ca_yk, :us]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]}],
|
||||||
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
|
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ca]},
|
||||||
|
@ -53,7 +50,6 @@ module Holidays
|
||||||
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Monday on or before May 24
|
# Monday on or before May 24
|
||||||
def self.ca_victoria_day(year)
|
def self.ca_victoria_day(year)
|
||||||
|
@ -70,4 +66,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::CA.defined_regions, Holidays::CA.holidays_by_month)
|
Holidays.merge_defs(Holidays::CA::DEFINED_REGIONS, Holidays::CA::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/cz.yaml
|
# Definitions loaded: data/cz.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/cz'
|
# require 'holidays/cz'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module CZ # :nodoc:
|
module CZ # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:cz]
|
||||||
[:cz]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Velikonoční pondělí", :regions => [:cz]}],
|
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Velikonoční pondělí", :regions => [:cz]}],
|
||||||
1 => [{:mday => 1, :name => "Den obnovy samostatného českého státu", :regions => [:cz]}],
|
1 => [{:mday => 1, :name => "Den obnovy samostatného českého státu", :regions => [:cz]}],
|
||||||
5 => [{:mday => 1, :name => "Svátek práce", :regions => [:cz]},
|
5 => [{:mday => 1, :name => "Svátek práce", :regions => [:cz]},
|
||||||
|
@ -32,9 +29,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "2. svátek vánoční", :regions => [:cz]}]
|
{:mday => 26, :name => "2. svátek vánoční", :regions => [:cz]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::CZ.defined_regions, Holidays::CZ.holidays_by_month)
|
Holidays.merge_defs(Holidays::CZ::DEFINED_REGIONS, Holidays::CZ::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/de.yaml
|
# Definitions loaded: data/de.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/de'
|
# require 'holidays/de'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module DE # :nodoc:
|
module DE # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_bb, :de_mv, :de_sn, :de_th]
|
||||||
[:de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_bb, :de_mv, :de_sn, :de_th]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:de]},
|
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:de]},
|
||||||
|
@ -35,7 +32,6 @@ module Holidays
|
||||||
{:mday => 26, :name => "2. Weihnachtstag", :regions => [:de]}]
|
{:mday => 26, :name => "2. Weihnachtstag", :regions => [:de]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Germany: Wednesday before November 23
|
# Germany: Wednesday before November 23
|
||||||
def self.de_buss_und_bettag(year)
|
def self.de_buss_und_bettag(year)
|
||||||
|
@ -52,4 +48,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::DE.defined_regions, Holidays::DE.holidays_by_month)
|
Holidays.merge_defs(Holidays::DE::DEFINED_REGIONS, Holidays::DE::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/dk.yaml
|
# Definitions loaded: data/dk.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/dk'
|
# require 'holidays/dk'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module DK # :nodoc:
|
module DK # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:dk]
|
||||||
[:dk]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
||||||
|
@ -44,9 +41,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "2. juledag", :regions => [:dk]}]
|
{:mday => 26, :name => "2. juledag", :regions => [:dk]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::DK.defined_regions, Holidays::DK.holidays_by_month)
|
Holidays.merge_defs(Holidays::DK::DEFINED_REGIONS, Holidays::DK::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
module Holidays
|
|
||||||
# This file is generated by the Ruby Holidays gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/el.yaml
|
|
||||||
#
|
|
||||||
# To use the definitions in this file, load it right after you load the
|
|
||||||
# Holiday gem:
|
|
||||||
#
|
|
||||||
# require 'holidays'
|
|
||||||
# require 'holidays/el'
|
|
||||||
#
|
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
|
||||||
module EL # :nodoc:
|
|
||||||
def self.defined_regions
|
|
||||||
[:el]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.orthodox_easter(year)-2 }, :function_id => "orthodox_easter(year)-2", :name => "Μεγάλη Παρασκευή", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)-1 }, :function_id => "orthodox_easter(year)-1", :name => "Μεγάλο Σάββατο", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year) }, :function_id => "orthodox_easter(year)", :name => "Κυριακή του Πάσχα", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)+1 }, :function_id => "orthodox_easter(year)+1", :name => "Δευτέρα του Πάσχα", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)-48 }, :function_id => "orthodox_easter(year)-48", :name => "Καθαρά Δευτέρα", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)+50 }, :function_id => "orthodox_easter(year)+50", :name => "Αγίου Πνεύματος", :regions => [:el]}],
|
|
||||||
1 => [{:mday => 1, :name => "Πρωτοχρονιά", :regions => [:el]},
|
|
||||||
{:mday => 6, :name => "Θεοφάνεια", :regions => [:el]}],
|
|
||||||
3 => [{:mday => 25, :name => "Επέτειος της Επανάστασης του 1821", :regions => [:el]}],
|
|
||||||
5 => [{:mday => 1, :name => "Πρωτομαγιά", :regions => [:el]}],
|
|
||||||
8 => [{:mday => 15, :name => "Κοίμηση της Θεοτόκου", :regions => [:el]}],
|
|
||||||
10 => [{:mday => 28, :name => "Επέτειος του Όχι", :regions => [:el]}],
|
|
||||||
12 => [{:mday => 25, :name => "Χριστούγεννα", :regions => [:el]},
|
|
||||||
{:mday => 26, :name => "Δεύτερη ημέρα των Χριστουγέννων", :regions => [:el]}]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::EL.defined_regions, Holidays::EL.holidays_by_month)
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/es.yaml
|
# Definitions loaded: data/es.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/es'
|
# require 'holidays/es'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module ES # :nodoc:
|
module ES # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex]
|
||||||
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Jueves Santo", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Jueves Santo", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Viernes Santo", :regions => [:es]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Viernes Santo", :regions => [:es]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunes de Pascua", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunes de Pascua", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]}],
|
||||||
|
@ -49,9 +46,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "San Esteban", :regions => [:es_ib, :es_ct]}]
|
{:mday => 26, :name => "San Esteban", :regions => [:es_ib, :es_ct]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::ES.defined_regions, Holidays::ES.holidays_by_month)
|
Holidays.merge_defs(Holidays::ES::DEFINED_REGIONS, Holidays::ES::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,28 +1,21 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/at.yaml, data/cz.yaml, data/dk.yaml, data/de.yaml, data/el.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/li.yaml, data/nl.yaml, data/no.yaml, data/pl.yaml, data/pt.yaml
|
# Definitions loaded: data/cz.yaml, data/dk.yaml, data/de.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/nl.yaml, data/no.yaml, data/pt.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/europe'
|
# require 'holidays/europe'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module Europe # :nodoc:
|
module Europe # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:cz, :dk, :no, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_st, :de_bb, :de_mv, :de_sn, :de_th, :es_pv, :es_ct, :es_na, :es_v, :es_vc, :es, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :ie, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :is, :it, :nl, :pt]
|
||||||
[:at, :de, :li, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :cz, :dk, :no, :de_st, :de_bb, :de_mv, :de_sn, :de_th, :el, :es_pv, :es_ct, :es_na, :es_v, :es_vc, :es, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :ie, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :is, :it, :nl, :pl, :pt]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Velikonoční pondělí", :regions => [:cz]},
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:at, :de, :li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:at, :de]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:at, :de, :li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:at, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Velikonoční pondělí", :regions => [:cz]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk, :no]},
|
{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk, :no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk, :no]},
|
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk, :no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
||||||
|
@ -33,13 +26,11 @@ module Holidays
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk, :no]},
|
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk, :no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de, :li]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)-2 }, :function_id => "orthodox_easter(year)-2", :name => "Μεγάλη Παρασκευή", :regions => [:el]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)-1 }, :function_id => "orthodox_easter(year)-1", :name => "Μεγάλο Σάββατο", :regions => [:el]},
|
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Christi Himmelfahrt", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year) }, :function_id => "orthodox_easter(year)", :name => "Κυριακή του Πάσχα", :regions => [:el]},
|
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:de]},
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)+1 }, :function_id => "orthodox_easter(year)+1", :name => "Δευτέρα του Πάσχα", :regions => [:el]},
|
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl]},
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)-48 }, :function_id => "orthodox_easter(year)-48", :name => "Καθαρά Δευτέρα", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.orthodox_easter(year)+50 }, :function_id => "orthodox_easter(year)+50", :name => "Αγίου Πνεύματος", :regions => [:el]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Jueves Santo", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Jueves Santo", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Viernes Santo", :regions => [:es]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Viernes Santo", :regions => [:es]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunes de Pascua", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunes de Pascua", :regions => [:es_pv, :es_ct, :es_na, :es_v, :es_vc]},
|
||||||
|
@ -64,9 +55,6 @@ module Holidays
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Annar í hvítasunnu", :regions => [:is]},
|
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Annar í hvítasunnu", :regions => [:is]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Fasnachtsdienstag", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :type => :informal, :name => "Ostern", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Auffahrt", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasen", :regions => [:nl]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasen", :regions => [:nl]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Pasen", :regions => [:nl]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Pasen", :regions => [:nl]},
|
||||||
|
@ -77,28 +65,14 @@ module Holidays
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "1. påskedag", :regions => [:no]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "1. påskedag", :regions => [:no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "1. pinsedag", :regions => [:no]},
|
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "1. pinsedag", :regions => [:no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. pinsedag", :regions => [:no]},
|
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. pinsedag", :regions => [:no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-52 }, :function_id => "easter(year)-52", :type => :informal, :name => "Tłusty Czwartek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Ostatki", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :type => :informal, :name => "Środa Popielcowa", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :type => :informal, :name => "Niedziela Palmowa", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :type => :informal, :name => "Wielki Czwartek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Wielki Piątek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :type => :informal, :name => "Wielka Sobota", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Niedziela Wielkanocna", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Poniedziałek Wielkanocny (Lany Poniedziałek)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Zesłanie Ducha Świętego (Zielone Świątki)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:pt]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:pt]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:pt]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:pt]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Corpo de Deus", :regions => [:pt]}],
|
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Corpo de Deus", :regions => [:pt]}],
|
||||||
1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:at, :de, :li]},
|
1 => [{:mday => 1, :name => "Den obnovy samostatného českého státu", :regions => [:cz]},
|
||||||
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:at]},
|
|
||||||
{:mday => 1, :name => "Den obnovy samostatného českého státu", :regions => [:cz]},
|
|
||||||
{:mday => 1, :name => "Nytårsdag", :regions => [:dk]},
|
{:mday => 1, :name => "Nytårsdag", :regions => [:dk]},
|
||||||
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:de_bw, :de_by, :de_st, :li, :li]},
|
{:mday => 1, :name => "Neujahrstag", :regions => [:de]},
|
||||||
{:mday => 1, :name => "Πρωτοχρονιά", :regions => [:el]},
|
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:de_bw, :de_by, :de_st]},
|
||||||
{:mday => 6, :name => "Θεοφάνεια", :regions => [:el]},
|
|
||||||
{:mday => 1, :name => "Año Nuevo", :regions => [:es]},
|
{:mday => 1, :name => "Año Nuevo", :regions => [:es]},
|
||||||
{:mday => 6, :name => "Día de Reyes", :regions => [:es]},
|
{:mday => 6, :name => "Día de Reyes", :regions => [:es]},
|
||||||
{:mday => 1, :name => "Jour de l'an", :regions => [:fr]},
|
{:mday => 1, :name => "Jour de l'an", :regions => [:fr]},
|
||||||
|
@ -111,19 +85,12 @@ module Holidays
|
||||||
{:mday => 6, :name => "Epifania", :regions => [:it]},
|
{:mday => 6, :name => "Epifania", :regions => [:it]},
|
||||||
{:mday => 1, :name => "Nieuwjaar", :regions => [:nl]},
|
{:mday => 1, :name => "Nieuwjaar", :regions => [:nl]},
|
||||||
{:mday => 1, :name => "Nyttårsdag", :regions => [:no]},
|
{:mday => 1, :name => "Nyttårsdag", :regions => [:no]},
|
||||||
{:mday => 1, :name => "Nowy Rok", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.pl_trzech_kroli(year) }, :function_id => "pl_trzech_kroli(year)", :name => "Objawienie Pańskie (święto Trzech Króli)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.pl_trzech_kroli_informal(year) }, :function_id => "pl_trzech_kroli_informal(year)", :type => :informal, :name => "Objawienie Pańskie (święto Trzech Króli)", :regions => [:pl]},
|
|
||||||
{:mday => 21, :type => :informal, :name => "Dzień Babci", :regions => [:pl]},
|
|
||||||
{:mday => 22, :type => :informal, :name => "Dzień Dziadka", :regions => [:pl]},
|
|
||||||
{:mday => 1, :name => "Ano Novo", :regions => [:pt]}],
|
{:mday => 1, :name => "Ano Novo", :regions => [:pt]}],
|
||||||
5 => [{:mday => 1, :name => "Staatsfeiertag", :regions => [:at]},
|
5 => [{:mday => 1, :name => "Svátek práce", :regions => [:cz]},
|
||||||
{:mday => 1, :name => "Svátek práce", :regions => [:cz]},
|
|
||||||
{:mday => 8, :name => "Den vítězství", :regions => [:cz]},
|
{:mday => 8, :name => "Den vítězství", :regions => [:cz]},
|
||||||
{:mday => 1, :name => "Arbejdernes kampdag", :regions => [:dk]},
|
{:mday => 1, :name => "Arbejdernes kampdag", :regions => [:dk]},
|
||||||
{:mday => 5, :type => :informal, :name => "Danmarks befrielse", :regions => [:dk]},
|
{:mday => 5, :type => :informal, :name => "Danmarks befrielse", :regions => [:dk]},
|
||||||
{:mday => 1, :name => "Tag der Arbeit", :regions => [:de, :li]},
|
{:mday => 1, :name => "Tag der Arbeit", :regions => [:de]},
|
||||||
{:mday => 1, :name => "Πρωτομαγιά", :regions => [:el]},
|
|
||||||
{:mday => 1, :name => "Día del Trabajador", :regions => [:es]},
|
{:mday => 1, :name => "Día del Trabajador", :regions => [:es]},
|
||||||
{:mday => 2, :name => "Fiesta de la Comunidad", :regions => [:es_m]},
|
{:mday => 2, :name => "Fiesta de la Comunidad", :regions => [:es_m]},
|
||||||
{:mday => 30, :name => "Día de las Canarias", :regions => [:es_cn]},
|
{:mday => 30, :name => "Día de las Canarias", :regions => [:es_cn]},
|
||||||
|
@ -140,36 +107,28 @@ module Holidays
|
||||||
{:mday => 5, :name => "Bevrijdingsdag", :regions => [:nl]},
|
{:mday => 5, :name => "Bevrijdingsdag", :regions => [:nl]},
|
||||||
{:mday => 1, :name => "1. mai", :regions => [:no]},
|
{:mday => 1, :name => "1. mai", :regions => [:no]},
|
||||||
{:mday => 17, :name => "17. mai", :regions => [:no]},
|
{:mday => 17, :name => "17. mai", :regions => [:no]},
|
||||||
{:mday => 1, :name => "Święto Państwowe (Święto Pracy)", :regions => [:pl]},
|
|
||||||
{:mday => 2, :type => :informal, :name => "Dzień Flagi Rzeczpospolitej Polskiej", :regions => [:pl]},
|
|
||||||
{:mday => 3, :name => "Święto Narodowe Trzeciego Maja", :regions => [:pl]},
|
|
||||||
{:mday => 1, :name => "Dia do Trabalhador", :regions => [:pt]}],
|
{:mday => 1, :name => "Dia do Trabalhador", :regions => [:pt]}],
|
||||||
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:at]},
|
7 => [{:mday => 5, :name => "Den slovanských věrozvěstů Cyrila a Metoděje", :regions => [:cz]},
|
||||||
{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]},
|
{:mday => 6, :name => "Den upálení mistra Jana Husa", :regions => [:cz]},
|
||||||
{:mday => 15, :name => "Κοίμηση της Θεοτόκου", :regions => [:el]},
|
{:mday => 23, :name => "Santiago Apostol", :regions => [:es_ga]},
|
||||||
{:mday => 15, :name => "Asunción", :regions => [:es]},
|
{:mday => 14, :name => "Fête nationale", :regions => [:fr]},
|
||||||
{:mday => 15, :name => "Assomption", :regions => [:fr]},
|
{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
|
||||||
{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct, :ie]},
|
{:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
|
||||||
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]},
|
9 => [{:mday => 28, :name => "Den české státnosti", :regions => [:cz]},
|
||||||
{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]},
|
{:mday => 2, :name => "Día de Ceuta", :regions => [:es_ce]},
|
||||||
{:mday => 15, :name => "Assunzione", :regions => [:it]},
|
{:mday => 8, :name => "Día de Asturias", :regions => [:es_o]},
|
||||||
{:mday => 15, :name => "Staatsfeiertag", :regions => [:li]},
|
{:mday => 8, :name => "Día de Extremadura", :regions => [:es_ex]},
|
||||||
{:mday => 15, :name => "Wniebowzięcie Najświętszej Maryi Panny", :regions => [:pl]},
|
{:mday => 11, :name => "Fiesta Nacional de Cataluña", :regions => [:es_ct]}],
|
||||||
{:mday => 15, :name => "Święto Wojska Polskiego", :regions => [:pl]},
|
10 => [{:mday => 28, :name => "Den vzniku samostatného československého státu", :regions => [:cz]},
|
||||||
{:mday => 15, :name => "Assunção de Nossa Senhora", :regions => [:pt]}],
|
|
||||||
10 => [{:mday => 26, :name => "Nationalfeiertag", :regions => [:at]},
|
|
||||||
{:mday => 28, :name => "Den vzniku samostatného československého státu", :regions => [:cz]},
|
|
||||||
{:mday => 3, :name => "Tag der Deutschen Einheit", :regions => [:de]},
|
{:mday => 3, :name => "Tag der Deutschen Einheit", :regions => [:de]},
|
||||||
{:mday => 31, :name => "Reformationstag", :regions => [:de_bb, :de_mv, :de_sn, :de_st, :de_th]},
|
{:mday => 31, :name => "Reformationstag", :regions => [:de_bb, :de_mv, :de_sn, :de_st, :de_th]},
|
||||||
{:mday => 28, :name => "Επέτειος του Όχι", :regions => [:el]},
|
|
||||||
{:mday => 9, :name => "Día de Valencia", :regions => [:es_vc, :es_v]},
|
{:mday => 9, :name => "Día de Valencia", :regions => [:es_vc, :es_v]},
|
||||||
{:mday => 12, :name => "Día de la Hispanidad", :regions => [:es]},
|
{:mday => 12, :name => "Día de la Hispanidad", :regions => [:es]},
|
||||||
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:ie]},
|
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:ie]},
|
||||||
{:mday => 14, :type => :informal, :name => "Dzień Nauczyciela (Dzień Edukacji Narodowej)", :regions => [:pl]},
|
|
||||||
{:mday => 5, :name => "Implantação da República", :regions => [:pt]}],
|
{:mday => 5, :name => "Implantação da República", :regions => [:pt]}],
|
||||||
11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:at, :de_bw, :de_by, :de_nw, :de_rp, :de_sl, :li]},
|
11 => [{:mday => 17, :name => "Den boje za svobodu a demokracii", :regions => [:cz]},
|
||||||
{:mday => 17, :name => "Den boje za svobodu a demokracii", :regions => [:cz]},
|
|
||||||
{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]},
|
{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]},
|
||||||
|
{:mday => 1, :name => "Allerheiligen", :regions => [:de_bw, :de_by, :de_nw, :de_rp, :de_sl]},
|
||||||
{:function => lambda { |year| Holidays.de_buss_und_bettag(year) }, :function_id => "de_buss_und_bettag(year)", :name => "Buß- und Bettag", :regions => [:de_sn]},
|
{:function => lambda { |year| Holidays.de_buss_und_bettag(year) }, :function_id => "de_buss_und_bettag(year)", :name => "Buß- und Bettag", :regions => [:de_sn]},
|
||||||
{:mday => 1, :name => "Todos los Santos", :regions => [:es]},
|
{:mday => 1, :name => "Todos los Santos", :regions => [:es]},
|
||||||
{:mday => 1, :name => "Toussaint", :regions => [:fr]},
|
{:mday => 1, :name => "Toussaint", :regions => [:fr]},
|
||||||
|
@ -177,23 +136,16 @@ module Holidays
|
||||||
{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]},
|
{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]},
|
||||||
{:mday => 16, :name => "Dagur íslenskrar tungu", :regions => [:is]},
|
{:mday => 16, :name => "Dagur íslenskrar tungu", :regions => [:is]},
|
||||||
{:mday => 1, :name => "Ognissanti", :regions => [:it]},
|
{:mday => 1, :name => "Ognissanti", :regions => [:it]},
|
||||||
{:mday => 1, :name => "Wszystkich Świętych", :regions => [:pl]},
|
|
||||||
{:mday => 2, :type => :informal, :name => "Dzień Zaduszny", :regions => [:pl]},
|
|
||||||
{:mday => 11, :name => "Narodowe Święto Niepodległości", :regions => [:pl]},
|
|
||||||
{:mday => 29, :type => :informal, :name => "Andrzejki", :regions => [:pl]},
|
|
||||||
{:mday => 1, :name => "Todos os Santos", :regions => [:pt]}],
|
{:mday => 1, :name => "Todos os Santos", :regions => [:pt]}],
|
||||||
12 => [{:mday => 8, :name => "Mariä Empfängnis", :regions => [:at]},
|
12 => [{:mday => 24, :name => "Štědrý den", :regions => [:cz]},
|
||||||
{:mday => 25, :name => "1. Weihnachtstag", :regions => [:at, :de]},
|
|
||||||
{:mday => 26, :name => "2. Weihnachtstag", :regions => [:at, :de]},
|
|
||||||
{:mday => 24, :name => "Štědrý den", :regions => [:cz]},
|
|
||||||
{:mday => 25, :name => "1. svátek vánoční", :regions => [:cz]},
|
{:mday => 25, :name => "1. svátek vánoční", :regions => [:cz]},
|
||||||
{:mday => 26, :name => "2. svátek vánoční", :regions => [:cz]},
|
{:mday => 26, :name => "2. svátek vánoční", :regions => [:cz]},
|
||||||
{:mday => 13, :type => :informal, :name => "Sankt Lucia", :regions => [:dk]},
|
{:mday => 13, :type => :informal, :name => "Sankt Lucia", :regions => [:dk]},
|
||||||
{:mday => 24, :name => "Juleaftensdag", :regions => [:dk]},
|
{:mday => 24, :name => "Juleaftensdag", :regions => [:dk]},
|
||||||
{:mday => 25, :name => "1. juledag", :regions => [:dk, :no]},
|
{:mday => 25, :name => "1. juledag", :regions => [:dk, :no]},
|
||||||
{:mday => 26, :name => "2. juledag", :regions => [:dk, :no]},
|
{:mday => 26, :name => "2. juledag", :regions => [:dk, :no]},
|
||||||
{:mday => 25, :name => "Χριστούγεννα", :regions => [:el]},
|
{:mday => 25, :name => "1. Weihnachtstag", :regions => [:de]},
|
||||||
{:mday => 26, :name => "Δεύτερη ημέρα των Χριστουγέννων", :regions => [:el]},
|
{:mday => 26, :name => "2. Weihnachtstag", :regions => [:de]},
|
||||||
{:mday => 6, :name => "Día de la Constitución", :regions => [:es]},
|
{:mday => 6, :name => "Día de la Constitución", :regions => [:es]},
|
||||||
{:mday => 8, :name => "Inmaculada Concepción", :regions => [:es]},
|
{:mday => 8, :name => "Inmaculada Concepción", :regions => [:es]},
|
||||||
{:mday => 25, :name => "Navidad del Señor", :regions => [:es]},
|
{:mday => 25, :name => "Navidad del Señor", :regions => [:es]},
|
||||||
|
@ -210,38 +162,14 @@ module Holidays
|
||||||
{:mday => 8, :name => "Immacolata Concezione", :regions => [:it]},
|
{:mday => 8, :name => "Immacolata Concezione", :regions => [:it]},
|
||||||
{:mday => 25, :name => "Natale", :regions => [:it]},
|
{:mday => 25, :name => "Natale", :regions => [:it]},
|
||||||
{:mday => 26, :name => "Santo Stefano", :regions => [:it]},
|
{:mday => 26, :name => "Santo Stefano", :regions => [:it]},
|
||||||
{:mday => 8, :name => "Maria Empfängnis", :regions => [:li]},
|
|
||||||
{:mday => 24, :name => "Heilig Abend", :regions => [:li]},
|
|
||||||
{:mday => 25, :name => "Weihnachten", :regions => [:li]},
|
|
||||||
{:mday => 26, :name => "Stefanstag", :regions => [:li]},
|
|
||||||
{:mday => 31, :name => "Silvester", :regions => [:li]},
|
|
||||||
{:mday => 5, :type => :informal, :name => "Sinterklaas", :regions => [:nl]},
|
{:mday => 5, :type => :informal, :name => "Sinterklaas", :regions => [:nl]},
|
||||||
{:mday => 25, :name => "Kerstmis", :regions => [:nl]},
|
{:mday => 25, :name => "Kerstmis", :regions => [:nl]},
|
||||||
{:mday => 26, :name => "Kerstmis", :regions => [:nl]},
|
{:mday => 26, :name => "Kerstmis", :regions => [:nl]},
|
||||||
{:mday => 24, :type => :informal, :name => "Julaften", :regions => [:no]},
|
{:mday => 24, :type => :informal, :name => "Julaften", :regions => [:no]},
|
||||||
{:mday => 31, :type => :informal, :name => "Nyttårsaften", :regions => [:no]},
|
{:mday => 31, :type => :informal, :name => "Nyttårsaften", :regions => [:no]},
|
||||||
{:mday => 4, :type => :informal, :name => "Barbórka (Dzień Górnika, Naftowca i Gazownika)", :regions => [:pl]},
|
|
||||||
{:mday => 6, :type => :informal, :name => "Mikołajki", :regions => [:pl]},
|
|
||||||
{:mday => 24, :type => :informal, :name => "Wigilia Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 25, :name => "pierwszy dzień Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 26, :name => "drugi dzień Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 31, :type => :informal, :name => "Sylwester", :regions => [:pl]},
|
|
||||||
{:mday => 1, :name => "Restauração da Independência", :regions => [:pt]},
|
{:mday => 1, :name => "Restauração da Independência", :regions => [:pt]},
|
||||||
{:mday => 8, :name => "Imaculada Conceição", :regions => [:pt]},
|
{:mday => 8, :name => "Imaculada Conceição", :regions => [:pt]},
|
||||||
{:mday => 25, :name => "Natal", :regions => [:pt]}],
|
{:mday => 25, :name => "Natal", :regions => [:pt]}],
|
||||||
7 => [{:mday => 5, :name => "Den slovanských věrozvěstů Cyrila a Metoděje", :regions => [:cz]},
|
|
||||||
{:mday => 6, :name => "Den upálení mistra Jana Husa", :regions => [:cz]},
|
|
||||||
{:mday => 23, :name => "Santiago Apostol", :regions => [:es_ga]},
|
|
||||||
{:mday => 14, :name => "Fête nationale", :regions => [:fr]},
|
|
||||||
{:mday => 5, :name => "Tynwald Day", :regions => [:im, :gb_iom]},
|
|
||||||
{:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
|
|
||||||
9 => [{:mday => 28, :name => "Den české státnosti", :regions => [:cz]},
|
|
||||||
{:mday => 2, :name => "Día de Ceuta", :regions => [:es_ce]},
|
|
||||||
{:mday => 8, :name => "Día de Asturias", :regions => [:es_o]},
|
|
||||||
{:mday => 8, :name => "Día de Extremadura", :regions => [:es_ex]},
|
|
||||||
{:mday => 11, :name => "Fiesta Nacional de Cataluña", :regions => [:es_ct]},
|
|
||||||
{:mday => 8, :name => "Maria Geburt", :regions => [:li]},
|
|
||||||
{:mday => 30, :type => :informal, :name => "Dzień Chłopaka", :regions => [:pl]}],
|
|
||||||
4 => [{:mday => 1, :type => :informal, :name => "1. april", :regions => [:dk]},
|
4 => [{:mday => 1, :type => :informal, :name => "1. april", :regions => [:dk]},
|
||||||
{:mday => 9, :type => :informal, :name => "Danmarks besættelse", :regions => [:dk]},
|
{:mday => 9, :type => :informal, :name => "Danmarks besættelse", :regions => [:dk]},
|
||||||
{:mday => 16, :type => :informal, :name => "Dronningens fødselsdag", :regions => [:dk]},
|
{:mday => 16, :type => :informal, :name => "Dronningens fødselsdag", :regions => [:dk]},
|
||||||
|
@ -250,8 +178,6 @@ module Holidays
|
||||||
{:function => lambda { |year| Holidays.is_sumardagurinn_fyrsti(year) }, :function_id => "is_sumardagurinn_fyrsti(year)", :name => "Sumardagurinn fyrsti", :regions => [:is]},
|
{:function => lambda { |year| Holidays.is_sumardagurinn_fyrsti(year) }, :function_id => "is_sumardagurinn_fyrsti(year)", :name => "Sumardagurinn fyrsti", :regions => [:is]},
|
||||||
{:mday => 25, :name => "Festa della Liberazione", :regions => [:it]},
|
{:mday => 25, :name => "Festa della Liberazione", :regions => [:it]},
|
||||||
{:mday => 30, :name => "Koninginnedag", :regions => [:nl]},
|
{:mday => 30, :name => "Koninginnedag", :regions => [:nl]},
|
||||||
{:mday => 1, :type => :informal, :name => "Prima Aprilis", :regions => [:pl]},
|
|
||||||
{:mday => 22, :type => :informal, :name => "Międzynarodowy Dzień Ziemi", :regions => [:pl]},
|
|
||||||
{:mday => 25, :name => "Dia da Liberdade", :regions => [:pt]}],
|
{:mday => 25, :name => "Dia da Liberdade", :regions => [:pt]}],
|
||||||
6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
|
6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
|
||||||
{:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
|
{:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
|
||||||
|
@ -262,24 +188,23 @@ module Holidays
|
||||||
{:mday => 3, :type => :informal, :name => "Sjómannadagurinn", :regions => [:is]},
|
{:mday => 3, :type => :informal, :name => "Sjómannadagurinn", :regions => [:is]},
|
||||||
{:mday => 17, :name => "Lýðveldisdagurinn", :regions => [:is]},
|
{:mday => 17, :name => "Lýðveldisdagurinn", :regions => [:is]},
|
||||||
{:mday => 2, :name => "Festa della Repubblica", :regions => [:it]},
|
{:mday => 2, :name => "Festa della Repubblica", :regions => [:it]},
|
||||||
{:mday => 23, :type => :informal, :name => "Dzień Ojca", :regions => [:pl]},
|
|
||||||
{:mday => 10, :name => "Dia de Portugal", :regions => [:pt]}],
|
{:mday => 10, :name => "Dia de Portugal", :regions => [:pt]}],
|
||||||
3 => [{:mday => 25, :name => "Επέτειος της Επανάστασης του 1821", :regions => [:el]},
|
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by, :de_sl]},
|
||||||
{:mday => 1, :name => "Día de las Islas Baleares", :regions => [:es_ib]},
|
{:mday => 15, :name => "Asunción", :regions => [:es]},
|
||||||
|
{:mday => 15, :name => "Assomption", :regions => [:fr]},
|
||||||
|
{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct, :ie]},
|
||||||
|
{:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]},
|
||||||
|
{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]},
|
||||||
|
{:mday => 15, :name => "Assunzione", :regions => [:it]},
|
||||||
|
{:mday => 15, :name => "Assunção de Nossa Senhora", :regions => [:pt]}],
|
||||||
|
2 => [{:mday => 28, :name => "Día de Andalucía", :regions => [:es_an]},
|
||||||
|
{:mday => 18, :type => :informal, :name => "Konudagur", :regions => [:is]}],
|
||||||
|
3 => [{:mday => 1, :name => "Día de las Islas Baleares", :regions => [:es_ib]},
|
||||||
{:mday => 19, :name => "San José", :regions => [:es_v, :es_vc, :es_cm, :es_mu, :es_m]},
|
{:mday => 19, :name => "San José", :regions => [:es_v, :es_vc, :es_cm, :es_mu, :es_m]},
|
||||||
{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
|
{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
|
||||||
{:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir, :ie]},
|
{:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir, :ie]}]
|
||||||
{:mday => 19, :name => "St. Josef", :regions => [:li]},
|
|
||||||
{:mday => 8, :type => :informal, :name => "Dzień Kobiet", :regions => [:pl]},
|
|
||||||
{:mday => 10, :type => :informal, :name => "Dzień Mężczyzn", :regions => [:pl]}],
|
|
||||||
2 => [{:mday => 28, :name => "Día de Andalucía", :regions => [:es_an]},
|
|
||||||
{:mday => 18, :type => :informal, :name => "Konudagur", :regions => [:is]},
|
|
||||||
{:mday => 2, :name => "Maria Lichtmess", :regions => [:li]},
|
|
||||||
{:mday => 2, :type => :informal, :name => "Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)", :regions => [:pl]},
|
|
||||||
{:mday => 14, :type => :informal, :name => "Dzień Zakochanych (Walentynki)", :regions => [:pl]}]
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Germany: Wednesday before November 23
|
# Germany: Wednesday before November 23
|
||||||
def self.de_buss_und_bettag(year)
|
def self.de_buss_und_bettag(year)
|
||||||
|
@ -305,19 +230,7 @@ def self.is_sumardagurinn_fyrsti(year)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Poland: January 6 is holiday since 2011
|
|
||||||
def self.pl_trzech_kroli(year)
|
|
||||||
year >= 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Poland: January 6 wasn't holiday before 2011
|
|
||||||
def self.pl_trzech_kroli_informal(year)
|
|
||||||
year < 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::Europe.defined_regions, Holidays::Europe.holidays_by_month)
|
Holidays.merge_defs(Holidays::Europe::DEFINED_REGIONS, Holidays::Europe::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/fi.yaml
|
# Definitions loaded: data/fi.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/fi'
|
# require 'holidays/fi'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module FI # :nodoc:
|
module FI # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:fi]
|
||||||
[:fi]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Pitkäperjantai", :regions => [:fi]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Pitkäperjantai", :regions => [:fi]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pääsiäispäivä", :regions => [:fi]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pääsiäispäivä", :regions => [:fi]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. Pääsiäispäivä", :regions => [:fi]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. Pääsiäispäivä", :regions => [:fi]},
|
||||||
|
@ -34,7 +31,6 @@ module Holidays
|
||||||
{:mday => 26, :name => "Tapaninpäivä", :regions => [:fi]}]
|
{:mday => 26, :name => "Tapaninpäivä", :regions => [:fi]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Finland: Mid-summer (Saturday between June 20–26)
|
# Finland: Mid-summer (Saturday between June 20–26)
|
||||||
def self.fi_juhannuspaiva(year)
|
def self.fi_juhannuspaiva(year)
|
||||||
|
@ -55,4 +51,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::FI.defined_regions, Holidays::FI.holidays_by_month)
|
Holidays.merge_defs(Holidays::FI::DEFINED_REGIONS, Holidays::FI::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/fr.yaml
|
# Definitions loaded: data/fr.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/fr'
|
# require 'holidays/fr'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module FR # :nodoc:
|
module FR # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:fr]
|
||||||
[:fr]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pâques", :regions => [:fr]},
|
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pâques", :regions => [:fr]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lundi de Pâques", :regions => [:fr]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lundi de Pâques", :regions => [:fr]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Ascension", :regions => [:fr]},
|
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Ascension", :regions => [:fr]},
|
||||||
|
@ -33,9 +30,8 @@ module Holidays
|
||||||
12 => [{:mday => 25, :name => "Nöel", :regions => [:fr]}]
|
12 => [{:mday => 25, :name => "Nöel", :regions => [:fr]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::FR.defined_regions, Holidays::FR.holidays_by_month)
|
Holidays.merge_defs(Holidays::FR::DEFINED_REGIONS, Holidays::FR::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/gb.yaml
|
# Definitions loaded: data/gb.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/gb'
|
# require 'holidays/gb'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module GB # :nodoc:
|
module GB # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom]
|
||||||
[:gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:gb]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:gb]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
|
||||||
|
@ -37,9 +34,8 @@ module Holidays
|
||||||
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}]
|
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::GB.defined_regions, Holidays::GB.holidays_by_month)
|
Holidays.merge_defs(Holidays::GB::DEFINED_REGIONS, Holidays::GB::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/ie.yaml
|
# Definitions loaded: data/ie.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/ie'
|
# require 'holidays/ie'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module IE # :nodoc:
|
module IE # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:ie]
|
||||||
[:ie]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:ie]}],
|
0 => [{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:ie]}],
|
||||||
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ie]}],
|
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:ie]}],
|
||||||
3 => [{:mday => 17, :name => "St. Patrick's Day", :regions => [:ie]}],
|
3 => [{:mday => 17, :name => "St. Patrick's Day", :regions => [:ie]}],
|
||||||
|
@ -29,9 +26,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "St. Stephen's Day", :regions => [:ie]}]
|
{:mday => 26, :name => "St. Stephen's Day", :regions => [:ie]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::IE.defined_regions, Holidays::IE.holidays_by_month)
|
Holidays.merge_defs(Holidays::IE::DEFINED_REGIONS, Holidays::IE::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/is.yaml
|
# Definitions loaded: data/is.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/is'
|
# require 'holidays/is'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module IS # :nodoc:
|
module IS # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:is]
|
||||||
[:is]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-48 }, :function_id => "easter(year)-48", :name => "Bolludagur", :regions => [:is]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-48 }, :function_id => "easter(year)-48", :name => "Bolludagur", :regions => [:is]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Sprengidagur", :regions => [:is]},
|
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Sprengidagur", :regions => [:is]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :name => "Öskudagur", :regions => [:is]},
|
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :name => "Öskudagur", :regions => [:is]},
|
||||||
|
@ -46,7 +43,6 @@ module Holidays
|
||||||
{:mday => 31, :name => "Gamlárskvöld", :regions => [:is]}]
|
{:mday => 31, :name => "Gamlárskvöld", :regions => [:is]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Iceland: first day of summer (Thursday after 18 April)
|
# Iceland: first day of summer (Thursday after 18 April)
|
||||||
def self.is_sumardagurinn_fyrsti(year)
|
def self.is_sumardagurinn_fyrsti(year)
|
||||||
|
@ -63,4 +59,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::IS.defined_regions, Holidays::IS.holidays_by_month)
|
Holidays.merge_defs(Holidays::IS::DEFINED_REGIONS, Holidays::IS::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/it.yaml
|
# Definitions loaded: data/it.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/it'
|
# require 'holidays/it'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module IT # :nodoc:
|
module IT # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:it]
|
||||||
[:it]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]}],
|
||||||
1 => [{:mday => 1, :name => "Capodanno", :regions => [:it]},
|
1 => [{:mday => 1, :name => "Capodanno", :regions => [:it]},
|
||||||
|
@ -32,9 +29,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "Santo Stefano", :regions => [:it]}]
|
{:mday => 26, :name => "Santo Stefano", :regions => [:it]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::IT.defined_regions, Holidays::IT.holidays_by_month)
|
Holidays.merge_defs(Holidays::IT::DEFINED_REGIONS, Holidays::IT::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/jp.yaml
|
# Definitions loaded: data/jp.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/jp'
|
# require 'holidays/jp'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module JP # :nodoc:
|
module JP # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:jp]
|
||||||
[:jp]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
1 => [{:mday => 1, :name => "元日", :regions => [:jp]},
|
1 => [{:mday => 1, :name => "元日", :regions => [:jp]},
|
||||||
{:wday => 1, :week => 2, :name => "成人の日", :regions => [:jp]}],
|
{:wday => 1, :week => 2, :name => "成人の日", :regions => [:jp]}],
|
||||||
2 => [{:mday => 11, :name => "建国記念日", :regions => [:jp]},
|
2 => [{:mday => 11, :name => "建国記念日", :regions => [:jp]},
|
||||||
|
@ -48,7 +45,6 @@ module Holidays
|
||||||
{:function => lambda { |year| Holidays.jp_substitute_holiday(year, 12, 23) }, :function_id => "jp_substitute_holiday(year, 12, 23)", :name => "振替休日", :regions => [:jp]}]
|
{:function => lambda { |year| Holidays.jp_substitute_holiday(year, 12, 23) }, :function_id => "jp_substitute_holiday(year, 12, 23)", :name => "振替休日", :regions => [:jp]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def self.jp_vernal_equinox_day(year)
|
def self.jp_vernal_equinox_day(year)
|
||||||
day =
|
day =
|
||||||
|
@ -110,4 +106,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::JP.defined_regions, Holidays::JP.holidays_by_month)
|
Holidays.merge_defs(Holidays::JP::DEFINED_REGIONS, Holidays::JP::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
module Holidays
|
|
||||||
# This file is generated by the Ruby Holidays gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/li.yaml
|
|
||||||
#
|
|
||||||
# To use the definitions in this file, load it right after you load the
|
|
||||||
# Holiday gem:
|
|
||||||
#
|
|
||||||
# require 'holidays'
|
|
||||||
# require 'holidays/li'
|
|
||||||
#
|
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
|
||||||
module LI # :nodoc:
|
|
||||||
def self.defined_regions
|
|
||||||
[:li]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Fasnachtsdienstag", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :type => :informal, :name => "Ostern", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Auffahrt", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pfingstmontag", :regions => [:li]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Fronleichnam", :regions => [:li]}],
|
|
||||||
1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:li]},
|
|
||||||
{:mday => 6, :name => "Heilige Drei Könige", :regions => [:li]}],
|
|
||||||
2 => [{:mday => 2, :name => "Maria Lichtmess", :regions => [:li]}],
|
|
||||||
3 => [{:mday => 19, :name => "St. Josef", :regions => [:li]}],
|
|
||||||
5 => [{:mday => 1, :name => "Tag der Arbeit", :regions => [:li]}],
|
|
||||||
8 => [{:mday => 15, :name => "Staatsfeiertag", :regions => [:li]}],
|
|
||||||
9 => [{:mday => 8, :name => "Maria Geburt", :regions => [:li]}],
|
|
||||||
11 => [{:mday => 1, :name => "Allerheiligen", :regions => [:li]}],
|
|
||||||
12 => [{:mday => 8, :name => "Maria Empfängnis", :regions => [:li]},
|
|
||||||
{:mday => 24, :name => "Heilig Abend", :regions => [:li]},
|
|
||||||
{:mday => 25, :name => "Weihnachten", :regions => [:li]},
|
|
||||||
{:mday => 26, :name => "Stefanstag", :regions => [:li]},
|
|
||||||
{:mday => 31, :name => "Silvester", :regions => [:li]}]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::LI.defined_regions, Holidays::LI.holidays_by_month)
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/mx.yaml, data/north_america_informal.yaml
|
# Definitions loaded: data/mx.yaml, data/north_america_informal.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/mx'
|
# require 'holidays/mx'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module MX # :nodoc:
|
module MX # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:mx, :mx_pue, :us, :ca]
|
||||||
[:mx, :mx_pue, :us, :ca]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
1 => [{:mday => 1, :name => "Año nuevo", :regions => [:mx]},
|
1 => [{:mday => 1, :name => "Año nuevo", :regions => [:mx]},
|
||||||
{:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]}],
|
{:mday => 6, :name => "Dia de los Santos Reyes", :regions => [:mx]}],
|
||||||
2 => [{:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
|
2 => [{:wday => 1, :week => 1, :name => "Día de la Constitución", :regions => [:mx]},
|
||||||
|
@ -48,9 +45,8 @@ module Holidays
|
||||||
{:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]}]
|
{:mday => 28, :name => "Los Santos Inocentes", :regions => [:mx]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::MX.defined_regions, Holidays::MX.holidays_by_month)
|
Holidays.merge_defs(Holidays::MX::DEFINED_REGIONS, Holidays::MX::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/nl.yaml
|
# Definitions loaded: data/nl.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/nl'
|
# require 'holidays/nl'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module NL # :nodoc:
|
module NL # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:nl]
|
||||||
[:nl]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasen", :regions => [:nl]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasen", :regions => [:nl]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Pasen", :regions => [:nl]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Pasen", :regions => [:nl]},
|
||||||
|
@ -33,9 +30,8 @@ module Holidays
|
||||||
{:mday => 26, :name => "Kerstmis", :regions => [:nl]}]
|
{:mday => 26, :name => "Kerstmis", :regions => [:nl]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::NL.defined_regions, Holidays::NL.holidays_by_month)
|
Holidays.merge_defs(Holidays::NL::DEFINED_REGIONS, Holidays::NL::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/no.yaml
|
# Definitions loaded: data/no.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/no'
|
# require 'holidays/no'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module NO # :nodoc:
|
module NO # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:no]
|
||||||
[:no]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:no]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:no]},
|
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skjærtorsdag", :regions => [:no]},
|
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skjærtorsdag", :regions => [:no]},
|
||||||
|
@ -36,9 +33,8 @@ module Holidays
|
||||||
{:mday => 31, :type => :informal, :name => "Nyttårsaften", :regions => [:no]}]
|
{:mday => 31, :type => :informal, :name => "Nyttårsaften", :regions => [:no]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::NO.defined_regions, Holidays::NO.holidays_by_month)
|
Holidays.merge_defs(Holidays::NO::DEFINED_REGIONS, Holidays::NO::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/ca.yaml, data/mx.yaml, data/us.yaml, data/north_america_informal.yaml
|
# Definitions loaded: data/ca.yaml, data/mx.yaml, data/us.yaml, data/north_america_informal.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/north_america'
|
# require 'holidays/north_america'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module North_America # :nodoc:
|
module North_America # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_nf, :ca_nt, :ca_nu, :ca_bc, :ca_ns, :ca_yk, :mx, :mx_pue, :us, :us_dc]
|
||||||
[:ca, :ca_qc, :ca_ab, :ca_on, :ca_sk, :ca_mb, :ca_nf, :ca_nt, :ca_nu, :ca_bc, :ca_ns, :ca_yk, :mx, :mx_pue, :us, :us_dc]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:ca]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :type => :informal, :name => "Easter Monday", :regions => [:ca]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
|
||||||
|
@ -86,7 +83,6 @@ module Holidays
|
||||||
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Monday on or before May 24
|
# Monday on or before May 24
|
||||||
def self.ca_victoria_day(year)
|
def self.ca_victoria_day(year)
|
||||||
|
@ -109,4 +105,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::North_America.defined_regions, Holidays::North_America.holidays_by_month)
|
Holidays.merge_defs(Holidays::North_America::DEFINED_REGIONS, Holidays::North_America::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/nyse.yaml
|
# Definitions loaded: data/nyse.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/nyse'
|
# require 'holidays/nyse'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module NYSE # :nodoc:
|
module NYSE # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:nyse]
|
||||||
[:nyse]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:nyse]}],
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:nyse]}],
|
||||||
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:nyse]},
|
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:nyse]},
|
||||||
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:nyse]}],
|
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:nyse]}],
|
||||||
|
@ -29,9 +26,8 @@ module Holidays
|
||||||
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:nyse]}]
|
12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:nyse]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::NYSE.defined_regions, Holidays::NYSE.holidays_by_month)
|
Holidays.merge_defs(Holidays::NYSE::DEFINED_REGIONS, Holidays::NYSE::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/nz.yaml
|
# Definitions loaded: data/nz.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/nz'
|
# require 'holidays/nz'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module NZ # :nodoc:
|
module NZ # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ot, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl]
|
||||||
[:nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ot, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:nz]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:nz]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:nz]},
|
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :name => "Easter Saturday", :regions => [:nz]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:nz]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:nz]}],
|
||||||
|
@ -44,7 +41,6 @@ module Holidays
|
||||||
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:nz]}]
|
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:nz]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def self.closest_monday(date)
|
def self.closest_monday(date)
|
||||||
if [1, 2, 3, 4].include?(date.wday)
|
if [1, 2, 3, 4].include?(date.wday)
|
||||||
|
@ -70,4 +66,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::NZ.defined_regions, Holidays::NZ.holidays_by_month)
|
Holidays.merge_defs(Holidays::NZ::DEFINED_REGIONS, Holidays::NZ::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
module Holidays
|
|
||||||
# This file is generated by the Ruby Holidays gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/pl.yaml
|
|
||||||
#
|
|
||||||
# To use the definitions in this file, load it right after you load the
|
|
||||||
# Holiday gem:
|
|
||||||
#
|
|
||||||
# require 'holidays'
|
|
||||||
# require 'holidays/pl'
|
|
||||||
#
|
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
|
||||||
module PL # :nodoc:
|
|
||||||
def self.defined_regions
|
|
||||||
[:pl]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-52 }, :function_id => "easter(year)-52", :type => :informal, :name => "Tłusty Czwartek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Ostatki", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :type => :informal, :name => "Środa Popielcowa", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :type => :informal, :name => "Niedziela Palmowa", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :type => :informal, :name => "Wielki Czwartek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Wielki Piątek", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :type => :informal, :name => "Wielka Sobota", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Niedziela Wielkanocna", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Poniedziałek Wielkanocny (Lany Poniedziałek)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Zesłanie Ducha Świętego (Zielone Świątki)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.easter(year)+60 }, :function_id => "easter(year)+60", :name => "Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)", :regions => [:pl]}],
|
|
||||||
1 => [{:mday => 1, :name => "Nowy Rok", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.pl_trzech_kroli(year) }, :function_id => "pl_trzech_kroli(year)", :name => "Objawienie Pańskie (święto Trzech Króli)", :regions => [:pl]},
|
|
||||||
{:function => lambda { |year| Holidays.pl_trzech_kroli_informal(year) }, :function_id => "pl_trzech_kroli_informal(year)", :type => :informal, :name => "Objawienie Pańskie (święto Trzech Króli)", :regions => [:pl]},
|
|
||||||
{:mday => 21, :type => :informal, :name => "Dzień Babci", :regions => [:pl]},
|
|
||||||
{:mday => 22, :type => :informal, :name => "Dzień Dziadka", :regions => [:pl]}],
|
|
||||||
2 => [{:mday => 2, :type => :informal, :name => "Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)", :regions => [:pl]},
|
|
||||||
{:mday => 14, :type => :informal, :name => "Dzień Zakochanych (Walentynki)", :regions => [:pl]}],
|
|
||||||
3 => [{:mday => 8, :type => :informal, :name => "Dzień Kobiet", :regions => [:pl]},
|
|
||||||
{:mday => 10, :type => :informal, :name => "Dzień Mężczyzn", :regions => [:pl]}],
|
|
||||||
4 => [{:mday => 1, :type => :informal, :name => "Prima Aprilis", :regions => [:pl]},
|
|
||||||
{:mday => 22, :type => :informal, :name => "Międzynarodowy Dzień Ziemi", :regions => [:pl]}],
|
|
||||||
5 => [{:mday => 1, :name => "Święto Państwowe (Święto Pracy)", :regions => [:pl]},
|
|
||||||
{:mday => 2, :type => :informal, :name => "Dzień Flagi Rzeczpospolitej Polskiej", :regions => [:pl]},
|
|
||||||
{:mday => 3, :name => "Święto Narodowe Trzeciego Maja", :regions => [:pl]}],
|
|
||||||
6 => [{:mday => 23, :type => :informal, :name => "Dzień Ojca", :regions => [:pl]}],
|
|
||||||
8 => [{:mday => 15, :name => "Wniebowzięcie Najświętszej Maryi Panny", :regions => [:pl]},
|
|
||||||
{:mday => 15, :name => "Święto Wojska Polskiego", :regions => [:pl]}],
|
|
||||||
9 => [{:mday => 30, :type => :informal, :name => "Dzień Chłopaka", :regions => [:pl]}],
|
|
||||||
10 => [{:mday => 14, :type => :informal, :name => "Dzień Nauczyciela (Dzień Edukacji Narodowej)", :regions => [:pl]}],
|
|
||||||
11 => [{:mday => 1, :name => "Wszystkich Świętych", :regions => [:pl]},
|
|
||||||
{:mday => 2, :type => :informal, :name => "Dzień Zaduszny", :regions => [:pl]},
|
|
||||||
{:mday => 11, :name => "Narodowe Święto Niepodległości", :regions => [:pl]},
|
|
||||||
{:mday => 29, :type => :informal, :name => "Andrzejki", :regions => [:pl]}],
|
|
||||||
12 => [{:mday => 4, :type => :informal, :name => "Barbórka (Dzień Górnika, Naftowca i Gazownika)", :regions => [:pl]},
|
|
||||||
{:mday => 6, :type => :informal, :name => "Mikołajki", :regions => [:pl]},
|
|
||||||
{:mday => 24, :type => :informal, :name => "Wigilia Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 25, :name => "pierwszy dzień Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 26, :name => "drugi dzień Bożego Narodzenia", :regions => [:pl]},
|
|
||||||
{:mday => 31, :type => :informal, :name => "Sylwester", :regions => [:pl]}]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Poland: January 6 is holiday since 2011
|
|
||||||
def self.pl_trzech_kroli(year)
|
|
||||||
year >= 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Poland: January 6 wasn't holiday before 2011
|
|
||||||
def self.pl_trzech_kroli_informal(year)
|
|
||||||
year < 2011 ? 6 : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::PL.defined_regions, Holidays::PL.holidays_by_month)
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/pt.yaml
|
# Definitions loaded: data/pt.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/pt'
|
# require 'holidays/pt'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module PT # :nodoc:
|
module PT # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:pt]
|
||||||
[:pt]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :type => :informal, :name => "Carnaval", :regions => [:pt]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:pt]},
|
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Sexta-feira Santa", :regions => [:pt]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:pt]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páscoa", :regions => [:pt]},
|
||||||
|
@ -34,9 +31,8 @@ module Holidays
|
||||||
{:mday => 25, :name => "Natal", :regions => [:pt]}]
|
{:mday => 25, :name => "Natal", :regions => [:pt]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::PT.defined_regions, Holidays::PT.holidays_by_month)
|
Holidays.merge_defs(Holidays::PT::DEFINED_REGIONS, Holidays::PT::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/dk.yaml, data/is.yaml, data/no.yaml, data/se.yaml, data/fi.yaml
|
# Definitions loaded: data/dk.yaml, data/is.yaml, data/no.yaml, data/se.yaml, data/fi.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/scandinavia'
|
# require 'holidays/scandinavia'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module Scandinavia # :nodoc:
|
module Scandinavia # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:dk, :no, :is, :se, :fi]
|
||||||
[:dk, :no, :is, :se, :fi]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk, :no]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-49 }, :function_id => "easter(year)-49", :type => :informal, :name => "Fastelavn", :regions => [:dk, :no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk, :no]},
|
{:function => lambda { |year| Holidays.easter(year)-7 }, :function_id => "easter(year)-7", :name => "Palmesøndag", :regions => [:dk, :no]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
{:function => lambda { |year| Holidays.easter(year)-3 }, :function_id => "easter(year)-3", :name => "Skærtorsdag", :regions => [:dk]},
|
||||||
|
@ -106,7 +103,6 @@ module Holidays
|
||||||
8 => [{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]}]
|
8 => [{:wday => 1, :week => 1, :name => "Frídagur verslunarmanna", :regions => [:is]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Iceland: first day of summer (Thursday after 18 April)
|
# Iceland: first day of summer (Thursday after 18 April)
|
||||||
def self.is_sumardagurinn_fyrsti(year)
|
def self.is_sumardagurinn_fyrsti(year)
|
||||||
|
@ -155,4 +151,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::Scandinavia.defined_regions, Holidays::Scandinavia.holidays_by_month)
|
Holidays.merge_defs(Holidays::Scandinavia::DEFINED_REGIONS, Holidays::Scandinavia::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/se.yaml
|
# Definitions loaded: data/se.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/se'
|
# require 'holidays/se'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module SE # :nodoc:
|
module SE # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:se]
|
||||||
[:se]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Långfredagen", :regions => [:se]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Långfredagen", :regions => [:se]},
|
||||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskdagen", :regions => [:se]},
|
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskdagen", :regions => [:se]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annandag påsk", :regions => [:se]},
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annandag påsk", :regions => [:se]},
|
||||||
|
@ -33,7 +30,6 @@ module Holidays
|
||||||
{:mday => 26, :name => "Annandag jul", :regions => [:se]}]
|
{:mday => 26, :name => "Annandag jul", :regions => [:se]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Sweden: Mid-summer (Saturday between June 20–26)
|
# Sweden: Mid-summer (Saturday between June 20–26)
|
||||||
def self.se_midsommardagen(year)
|
def self.se_midsommardagen(year)
|
||||||
|
@ -54,4 +50,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::SE.defined_regions, Holidays::SE.holidays_by_month)
|
Holidays.merge_defs(Holidays::SE::DEFINED_REGIONS, Holidays::SE::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,85 +1,25 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/united_nations.yaml
|
# Definitions loaded: data/united_nations.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/united_nations'
|
# require 'holidays/united_nations'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module United_Nations # :nodoc:
|
module United_Nations # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:]
|
||||||
[:united_nations]
|
|
||||||
end
|
HOLIDAYS_BY_MONTH = {
|
||||||
|
|
||||||
def self.holidays_by_month
|
|
||||||
{
|
|
||||||
2 => [{:mday => 2, :name => "International Mother Language Day", :regions => [:united_nations]}],
|
|
||||||
3 => [{:mday => 8, :name => "United Nations Day for Women's Rights and International Peace", :regions => [:united_nations]},
|
|
||||||
{:mday => 21, :name => "International Day for the Elimination of Racial Discrimination", :regions => [:united_nations]},
|
|
||||||
{:mday => 21, :name => "Beginning of the Week of Solidarity with the Peoples Struggling against Racism and Racial Discrimination", :regions => [:united_nations]},
|
|
||||||
{:mday => 22, :name => "World Day for Water", :regions => [:united_nations]},
|
|
||||||
{:mday => 23, :name => "World Meteorological Day", :regions => [:united_nations]}],
|
|
||||||
4 => [{:mday => 7, :name => "World Health Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 23, :name => "World Book and Copyright Day", :regions => [:united_nations]}],
|
|
||||||
5 => [{:mday => 3, :name => "World Press Freedom Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 15, :name => "International Day of Families", :regions => [:united_nations]},
|
|
||||||
{:mday => 17, :name => "World Telecommunication Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 21, :name => "World Day for Cultural Diversity for Dialogue and Development", :regions => [:united_nations]},
|
|
||||||
{:mday => 22, :name => "International Day for Biological Diversity", :regions => [:united_nations]},
|
|
||||||
{:mday => 25, :name => "Beginning of the Week of Solidarity with the Peoples of Non-Self-Governing Territories", :regions => [:united_nations]},
|
|
||||||
{:mday => 29, :name => "International Day of United Nations Peacekeepers", :regions => [:united_nations]},
|
|
||||||
{:mday => 31, :name => "World No-Tobacco Day", :regions => [:united_nations]}],
|
|
||||||
6 => [{:mday => 4, :name => "International Day of Innocent Children Victims of Aggression", :regions => [:united_nations]},
|
|
||||||
{:mday => 5, :name => "World Environment Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 17, :name => "World Day to Combat Desertification and Drought", :regions => [:united_nations]},
|
|
||||||
{:mday => 20, :name => "World Refugee Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 23, :name => "United Nations Public Service Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 26, :name => "International Day against Drug Abuse and Illicit Trafficking", :regions => [:united_nations]},
|
|
||||||
{:mday => 26, :name => "International Day in Support of Victims of Torture", :regions => [:united_nations]}],
|
|
||||||
7 => [{:wday => 6, :week => 1, :name => "International Day of Cooperatives", :regions => [:united_nations]},
|
|
||||||
{:mday => 11, :name => "World Population Day", :regions => [:united_nations]}],
|
|
||||||
8 => [{:mday => 9, :name => "International Day of the World's Indigenous People", :regions => [:united_nations]},
|
|
||||||
{:mday => 12, :name => "International Youth Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 23, :name => "International Day for the Remembrance of the Slave Trade and Its Abolition", :regions => [:united_nations]}],
|
|
||||||
9 => [{:mday => 8, :name => "International Literacy Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 16, :name => "International Day for the Preservation of the Ozone Layer", :regions => [:united_nations]},
|
|
||||||
{:mday => 21, :name => "International Day of Peace", :regions => [:united_nations]},
|
|
||||||
{:mday => 1, :name => "International Day of Older Persons", :regions => [:united_nations]}],
|
|
||||||
10 => [{:mday => 4, :name => "World Space Week", :regions => [:united_nations]},
|
|
||||||
{:mday => 5, :name => "World Teachers' Day", :regions => [:united_nations]},
|
|
||||||
{:wday => 1, :week => 1, :name => "World Habitat Day", :regions => [:united_nations]},
|
|
||||||
{:wday => 3, :week => 2, :name => "International Day for Natural Disaster Reduction", :regions => [:united_nations]},
|
|
||||||
{:mday => 9, :name => "World Post Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 10, :name => "World Mental Health Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 16, :name => "World Food Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 17, :name => "International Day for the Eradication of Poverty", :regions => [:united_nations]},
|
|
||||||
{:mday => 24, :name => "United Nations Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 24, :name => "World Development Information Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 24, :name => "Disarmament Week", :regions => [:united_nations]}],
|
|
||||||
11 => [{:mday => 6, :name => "International Day for Preventing the Exploitation of the Environment in War and Armed Conflict", :regions => [:united_nations]},
|
|
||||||
{:mday => 16, :name => "International Day for Tolerance", :regions => [:united_nations]},
|
|
||||||
{:mday => 20, :name => "Africa Industrialization Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 20, :name => "Universal Children's Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 21, :name => "World Television Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 25, :name => "International Day for the Elimination of Violence against Women", :regions => [:united_nations]},
|
|
||||||
{:mday => 29, :name => "International Day of Solidarity with the Palestinian People", :regions => [:united_nations]}],
|
|
||||||
12 => [{:mday => 1, :name => "World AIDS Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 2, :name => "International Day for the Abolition of Slavery", :regions => [:united_nations]},
|
|
||||||
{:mday => 3, :name => "International Day of Disabled Persons", :regions => [:united_nations]},
|
|
||||||
{:mday => 5, :name => "International Volunteer Day for Economic and Social Development", :regions => [:united_nations]},
|
|
||||||
{:mday => 7, :name => "International Civil Aviation Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 10, :name => "Human Rights Day", :regions => [:united_nations]},
|
|
||||||
{:mday => 18, :name => "International Migrants Day", :regions => [:united_nations]}]
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::United_Nations.defined_regions, Holidays::United_Nations.holidays_by_month)
|
Holidays.merge_defs(Holidays::United_Nations::DEFINED_REGIONS, Holidays::United_Nations::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/ups.yaml
|
# Definitions loaded: data/ups.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/ups'
|
# require 'holidays/ups'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module UPS # :nodoc:
|
module UPS # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:ups]
|
||||||
[:ups]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:ups]}],
|
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:ups]}],
|
||||||
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:ups]}],
|
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:ups]}],
|
||||||
7 => [{:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:ups]}],
|
7 => [{:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:ups]}],
|
||||||
|
@ -28,9 +25,8 @@ module Holidays
|
||||||
{:mday => 31, :name => "New Year's Eve", :regions => [:ups]}]
|
{:mday => 31, :name => "New Year's Eve", :regions => [:ups]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::UPS.defined_regions, Holidays::UPS.holidays_by_month)
|
Holidays.merge_defs(Holidays::UPS::DEFINED_REGIONS, Holidays::UPS::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/us.yaml, data/north_america_informal.yaml
|
# Definitions loaded: data/us.yaml, data/north_america_informal.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/us'
|
# require 'holidays/us'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module US # :nodoc:
|
module US # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:us, :us_dc, :ca]
|
||||||
[:us, :us_dc, :ca]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :type => :informal, :name => "Good Friday", :regions => [:us]}],
|
||||||
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:us]},
|
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:us]},
|
||||||
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
|
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
|
||||||
|
@ -39,7 +36,6 @@ module Holidays
|
||||||
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
{:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# January 20, every fourth year, following Presidential election
|
# January 20, every fourth year, following Presidential election
|
||||||
def self.us_inauguration_day(year)
|
def self.us_inauguration_day(year)
|
||||||
|
@ -50,4 +46,4 @@ end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::US.defined_regions, Holidays::US.holidays_by_month)
|
Holidays.merge_defs(Holidays::US::DEFINED_REGIONS, Holidays::US::HOLIDAYS_BY_MONTH)
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
module Holidays
|
module Holidays
|
||||||
# This file is generated by the Ruby Holidays gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/za.yaml
|
# Definitions loaded: data/za.yaml
|
||||||
#
|
#
|
||||||
# To use the definitions in this file, load it right after you load the
|
# To use the definitions in this file, load them right after you load the
|
||||||
# Holiday gem:
|
# Holiday gem:
|
||||||
#
|
#
|
||||||
# require 'holidays'
|
# require 'holidays'
|
||||||
# require 'holidays/za'
|
# require 'holidays/za'
|
||||||
#
|
#
|
||||||
# All the definitions are available at https://github.com/alexdunae/holidays
|
# More definitions are available at http://code.dunae.ca/holidays.
|
||||||
module ZA # :nodoc:
|
module ZA # :nodoc:
|
||||||
def self.defined_regions
|
DEFINED_REGIONS = [:za]
|
||||||
[:za]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.holidays_by_month
|
HOLIDAYS_BY_MONTH = {
|
||||||
{
|
|
||||||
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:za]},
|
0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:za]},
|
||||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Family Day", :regions => [:za]}],
|
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Family Day", :regions => [:za]}],
|
||||||
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "New Year's Day", :regions => [:za]}],
|
1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_sunday(date) }, :observed_id => "to_monday_if_sunday", :name => "New Year's Day", :regions => [:za]}],
|
||||||
|
@ -32,9 +29,8 @@ module Holidays
|
||||||
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Day of Goodwill", :regions => [:za]}]
|
{:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Day of Goodwill", :regions => [:za]}]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Holidays.merge_defs(Holidays::ZA.defined_regions, Holidays::ZA.holidays_by_month)
|
Holidays.merge_defs(Holidays::ZA::DEFINED_REGIONS, Holidays::ZA::HOLIDAYS_BY_MONTH)
|
||||||
|
|
10
rakefile.rb
10
rakefile.rb
|
@ -1,14 +1,13 @@
|
||||||
$:.unshift File.expand_path('../lib', __FILE__)
|
$:.unshift File.expand_path('../lib', __FILE__)
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
require 'rdoc/task'
|
require 'rake/rdoctask'
|
||||||
|
require 'rake/gempackagetask'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'holidays'
|
require 'holidays'
|
||||||
require File.expand_path('data/build_defs')
|
require File.expand_path('data/build_defs')
|
||||||
|
|
||||||
task :default => :test
|
|
||||||
|
|
||||||
desc 'Run all tests'
|
desc 'Run all tests'
|
||||||
task :test => ["test:lib", "test:defs"]
|
task :test => ["test:lib", "test:defs"]
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ end
|
||||||
task :doc => ["defs:manifest", :rdoc]
|
task :doc => ["defs:manifest", :rdoc]
|
||||||
|
|
||||||
desc 'Generate documentation.'
|
desc 'Generate documentation.'
|
||||||
RDoc::Task.new do |rdoc|
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
||||||
rdoc.rdoc_dir = 'doc'
|
rdoc.rdoc_dir = 'doc'
|
||||||
rdoc.title = 'Ruby Holidays Gem'
|
rdoc.title = 'Ruby Holidays Gem'
|
||||||
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
|
rdoc.options << '--all' << '--inline-source' << '--line-numbers'
|
||||||
|
@ -99,8 +98,7 @@ begin
|
||||||
gemspec.email = "code@dunae.ca"
|
gemspec.email = "code@dunae.ca"
|
||||||
gemspec.homepage = "https://github.com/alexdunae/holidays"
|
gemspec.homepage = "https://github.com/alexdunae/holidays"
|
||||||
gemspec.version = Holidays::VERSION
|
gemspec.version = Holidays::VERSION
|
||||||
gemspec.authors = ["Alex Dunae"]
|
gemspec.authors = ["Alex Dunae", "Rowan Crawford"]
|
||||||
gemspec.add_development_dependency 'rdoc', '>= 2.4.2'
|
|
||||||
end
|
end
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
puts "Jeweler not available. Install it with: gem install jeweler"
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
||||||
|
|
||||||
# This file is generated by the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/at.yaml
|
|
||||||
class AtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
||||||
|
|
||||||
def test_at
|
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,1) => 'Staatsfeiertag',
|
|
||||||
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,10,26) => 'Nationalfeiertag',
|
|
||||||
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
|
||||||
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :at, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
assert !Date.civil(2010,5,8).holiday?(:at), '2010-05-08 is not a holiday in Austria'
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,28 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
||||||
|
|
||||||
# This file is generated by the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/el.yaml
|
|
||||||
class ElDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
||||||
|
|
||||||
def test_el
|
|
||||||
{Date.civil(2011,1,1) => 'Πρωτοχρονιά',
|
|
||||||
Date.civil(2011,1,6) => 'Θεοφάνεια',
|
|
||||||
Date.civil(2011,4,22) => 'Μεγάλη Παρασκευή',
|
|
||||||
Date.civil(1970,4,25) => 'Μεγάλο Σάββατο',
|
|
||||||
Date.civil(1985,4,14) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2011,4,24) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2027,5,2) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2046,4,30) => 'Δευτέρα του Πάσχα',
|
|
||||||
Date.civil(2011,5,1) => 'Πρωτομαγιά',
|
|
||||||
Date.civil(2011,6,13) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2012,6,4) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2011,3,7) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2012,2,27) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2011,12,25) => 'Χριστούγεννα',
|
|
||||||
Date.civil(2011,12,26) => 'Δεύτερη ημέρα των Χριστουγέννων'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :el, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -3,24 +3,10 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
||||||
|
|
||||||
# This file is generated by the Ruby Holiday gem.
|
# This file is generated by the Ruby Holiday gem.
|
||||||
#
|
#
|
||||||
# Definitions loaded: data/at.yaml, data/cz.yaml, data/dk.yaml, data/de.yaml, data/el.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/li.yaml, data/nl.yaml, data/no.yaml, data/pl.yaml, data/pt.yaml
|
# Definitions loaded: data/cz.yaml, data/dk.yaml, data/de.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/nl.yaml, data/no.yaml, data/pt.yaml
|
||||||
class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
||||||
|
|
||||||
def test_europe
|
def test_europe
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,1) => 'Staatsfeiertag',
|
|
||||||
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,10,26) => 'Nationalfeiertag',
|
|
||||||
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
|
||||||
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :at, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
assert !Date.civil(2010,5,8).holiday?(:at), '2010-05-08 is not a holiday in Austria'
|
|
||||||
|
|
||||||
|
|
||||||
{Date.civil(2010,1,1) => 'Den obnovy samostatného českého státu',
|
{Date.civil(2010,1,1) => 'Den obnovy samostatného českého státu',
|
||||||
Date.civil(2010,4,5) => 'Velikonoční pondělí',
|
Date.civil(2010,4,5) => 'Velikonoční pondělí',
|
||||||
Date.civil(2010,5,1) => 'Svátek práce',
|
Date.civil(2010,5,1) => 'Svátek práce',
|
||||||
|
@ -98,24 +84,6 @@ assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:nam
|
||||||
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
|
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
|
||||||
|
|
||||||
|
|
||||||
{Date.civil(2011,1,1) => 'Πρωτοχρονιά',
|
|
||||||
Date.civil(2011,1,6) => 'Θεοφάνεια',
|
|
||||||
Date.civil(2011,4,22) => 'Μεγάλη Παρασκευή',
|
|
||||||
Date.civil(1970,4,25) => 'Μεγάλο Σάββατο',
|
|
||||||
Date.civil(1985,4,14) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2011,4,24) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2027,5,2) => 'Κυριακή του Πάσχα',
|
|
||||||
Date.civil(2046,4,30) => 'Δευτέρα του Πάσχα',
|
|
||||||
Date.civil(2011,5,1) => 'Πρωτομαγιά',
|
|
||||||
Date.civil(2011,6,13) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2012,6,4) => 'Αγίου Πνεύματος',
|
|
||||||
Date.civil(2011,3,7) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2012,2,27) => 'Καθαρά Δευτέρα',
|
|
||||||
Date.civil(2011,12,25) => 'Χριστούγεννα',
|
|
||||||
Date.civil(2011,12,26) => 'Δεύτερη ημέρα των Χριστουγέννων'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :el, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
{Date.civil(2009,1,1) => 'Año Nuevo',
|
{Date.civil(2009,1,1) => 'Año Nuevo',
|
||||||
Date.civil(2009,1,6) => 'Día de Reyes',
|
Date.civil(2009,1,6) => 'Día de Reyes',
|
||||||
Date.civil(2009,4,10) => 'Viernes Santo',
|
Date.civil(2009,4,10) => 'Viernes Santo',
|
||||||
|
@ -254,31 +222,6 @@ end
|
||||||
assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name]
|
assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name]
|
||||||
end
|
end
|
||||||
|
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2011,3,8) => 'Fasnachtsdienstag',
|
|
||||||
Date.civil(2009,4,10) => 'Karfreitag',
|
|
||||||
Date.civil(2009,4,12) => 'Ostern',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,21) => 'Auffahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,12,25) => 'Weihnachten',
|
|
||||||
Date.civil(2009,12,26) => 'Stefanstag'}.each do |date, name|
|
|
||||||
assert_equal name, Holidays.on(date, :li, :informal)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Staatsfeiertag', Date.civil(2009,8,15).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
{Date.civil(2008,1,1) => 'Nieuwjaar',
|
{Date.civil(2008,1,1) => 'Nieuwjaar',
|
||||||
Date.civil(2008,3,21) => 'Goede Vrijdag',
|
Date.civil(2008,3,21) => 'Goede Vrijdag',
|
||||||
Date.civil(2008,3,23) => 'Pasen',
|
Date.civil(2008,3,23) => 'Pasen',
|
||||||
|
@ -312,141 +255,6 @@ end
|
||||||
assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
|
assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
|
||||||
end
|
end
|
||||||
|
|
||||||
{Date.civil(2011,1,1) => 'Nowy Rok',
|
|
||||||
Date.civil(2011,5,1) => 'Święto Państwowe (Święto Pracy)',
|
|
||||||
Date.civil(2011,5,3) => 'Święto Narodowe Trzeciego Maja',
|
|
||||||
Date.civil(2011,11,1) => 'Wszystkich Świętych',
|
|
||||||
Date.civil(2011,11,11) => 'Narodowe Święto Niepodległości',
|
|
||||||
Date.civil(2011,12,25) => 'pierwszy dzień Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,26) => 'drugi dzień Bożego Narodzenia'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Objawienie Pańskie (święto Trzech Króli) -- formal since 2011
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2011,1,6), Date.civil(2012,1,6), Date.civil(2013,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Tłusty Czwartek
|
|
||||||
[Date.civil(2008,1,31), Date.civil(2009,2,19), Date.civil(2010,2,11),
|
|
||||||
Date.civil(2011,3,3), Date.civil(2012,2,16)].each do |date|
|
|
||||||
assert_equal 'Tłusty Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Ostatki
|
|
||||||
[Date.civil(2008,2,5), Date.civil(2009,2,24), Date.civil(2010,2,16),
|
|
||||||
Date.civil(2011,3,8), Date.civil(2012,2,21)].each do |date|
|
|
||||||
assert_equal 'Ostatki', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Środa Popielcowa
|
|
||||||
[Date.civil(2008,2,6), Date.civil(2009,2,25), Date.civil(2010,2,17),
|
|
||||||
Date.civil(2011,3,9), Date.civil(2012,2,22)].each do |date|
|
|
||||||
assert_equal 'Środa Popielcowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Palmowa
|
|
||||||
[Date.civil(2008,3,16), Date.civil(2009,4,5), Date.civil(2010,3,28),
|
|
||||||
Date.civil(2011,4,17), Date.civil(2012,4,1)].each do |date|
|
|
||||||
assert_equal 'Niedziela Palmowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Czwartek
|
|
||||||
[Date.civil(2008,3,20), Date.civil(2009,4,9), Date.civil(2010,4,1),
|
|
||||||
Date.civil(2011,4,21), Date.civil(2012,4,5)].each do |date|
|
|
||||||
assert_equal 'Wielki Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Piątek
|
|
||||||
[Date.civil(2008,3,21), Date.civil(2009,4,10), Date.civil(2010,4,2),
|
|
||||||
Date.civil(2011,4,22), Date.civil(2012,4,6)].each do |date|
|
|
||||||
assert_equal 'Wielki Piątek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielka Sobota
|
|
||||||
[Date.civil(2008,3,22), Date.civil(2009,4,11), Date.civil(2010,4,3),
|
|
||||||
Date.civil(2011,4,23), Date.civil(2012,4,7)].each do |date|
|
|
||||||
assert_equal 'Wielka Sobota', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Wielkanocna
|
|
||||||
[Date.civil(2008,3,23), Date.civil(2009,4,12), Date.civil(2010,4,4),
|
|
||||||
Date.civil(2011,4,24), Date.civil(2012,4,8)].each do |date|
|
|
||||||
assert_equal 'Niedziela Wielkanocna', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
||||||
[Date.civil(2008,3,24), Date.civil(2009,4,13), Date.civil(2010,4,5),
|
|
||||||
Date.civil(2011,4,25), Date.civil(2012,4,9)].each do |date|
|
|
||||||
assert_equal 'Poniedziałek Wielkanocny (Lany Poniedziałek)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Zesłanie Ducha Świętego (Zielone Świątki)
|
|
||||||
[Date.civil(2008,5,11), Date.civil(2009,5,31), Date.civil(2010,5,23),
|
|
||||||
Date.civil(2011,6,12), Date.civil(2012,5,27)].each do |date|
|
|
||||||
assert_equal 'Zesłanie Ducha Świętego (Zielone Świątki)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
||||||
[Date.civil(2008,5,22), Date.civil(2009,6,11), Date.civil(2010,6,3),
|
|
||||||
Date.civil(2011,6,23), Date.civil(2012,6,7)].each do |date|
|
|
||||||
assert_equal 'Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wniebowzięcie Najświętszej Maryi Panny & Święto Wojska Polskiego
|
|
||||||
assert_equal 'Wniebowzięcie Najświętszej Maryi Panny', (Holidays.on(Date.civil(2011,8,15), :pl)[0] || {})[:name]
|
|
||||||
assert_equal 'Święto Wojska Polskiego', (Holidays.on(Date.civil(2011,8,15), :pl)[1] || {})[:name]
|
|
||||||
|
|
||||||
{Date.civil(2008,1,1) => 'Ano Novo',
|
{Date.civil(2008,1,1) => 'Ano Novo',
|
||||||
Date.civil(2005,2,8) => 'Carnaval',
|
Date.civil(2005,2,8) => 'Carnaval',
|
||||||
Date.civil(2006,2,28) => 'Carnaval',
|
Date.civil(2006,2,28) => 'Carnaval',
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
||||||
|
|
||||||
# This file is generated by the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/li.yaml
|
|
||||||
class LiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
||||||
|
|
||||||
def test_li
|
|
||||||
{Date.civil(2009,1,1) => 'Neujahrstag',
|
|
||||||
Date.civil(2011,3,8) => 'Fasnachtsdienstag',
|
|
||||||
Date.civil(2009,4,10) => 'Karfreitag',
|
|
||||||
Date.civil(2009,4,12) => 'Ostern',
|
|
||||||
Date.civil(2009,4,13) => 'Ostermontag',
|
|
||||||
Date.civil(2009,5,21) => 'Auffahrt',
|
|
||||||
Date.civil(2009,6,1) => 'Pfingstmontag',
|
|
||||||
Date.civil(2009,12,25) => 'Weihnachten',
|
|
||||||
Date.civil(2009,12,26) => 'Stefanstag'}.each do |date, name|
|
|
||||||
assert_equal name, Holidays.on(date, :li, :informal)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Staatsfeiertag', Date.civil(2009,8,15).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
[:li].each do |r|
|
|
||||||
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,145 +0,0 @@
|
||||||
# encoding: utf-8
|
|
||||||
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
||||||
|
|
||||||
# This file is generated by the Ruby Holiday gem.
|
|
||||||
#
|
|
||||||
# Definitions loaded: data/pl.yaml
|
|
||||||
class PlDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
||||||
|
|
||||||
def test_pl
|
|
||||||
{Date.civil(2011,1,1) => 'Nowy Rok',
|
|
||||||
Date.civil(2011,5,1) => 'Święto Państwowe (Święto Pracy)',
|
|
||||||
Date.civil(2011,5,3) => 'Święto Narodowe Trzeciego Maja',
|
|
||||||
Date.civil(2011,11,1) => 'Wszystkich Świętych',
|
|
||||||
Date.civil(2011,11,11) => 'Narodowe Święto Niepodległości',
|
|
||||||
Date.civil(2011,12,25) => 'pierwszy dzień Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,26) => 'drugi dzień Bożego Narodzenia'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal name, (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# informal
|
|
||||||
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
||||||
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
||||||
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
||||||
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
||||||
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
||||||
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
||||||
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
||||||
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
||||||
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
||||||
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
||||||
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
||||||
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
||||||
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
||||||
Date.civil(2011,11,29) => 'Andrzejki',
|
|
||||||
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
||||||
Date.civil(2011,12,6) => 'Mikołajki',
|
|
||||||
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
||||||
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Objawienie Pańskie (święto Trzech Króli) -- formal since 2011
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
[Date.civil(2011,1,6), Date.civil(2012,1,6), Date.civil(2013,1,6)].each do |date|
|
|
||||||
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Tłusty Czwartek
|
|
||||||
[Date.civil(2008,1,31), Date.civil(2009,2,19), Date.civil(2010,2,11),
|
|
||||||
Date.civil(2011,3,3), Date.civil(2012,2,16)].each do |date|
|
|
||||||
assert_equal 'Tłusty Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Ostatki
|
|
||||||
[Date.civil(2008,2,5), Date.civil(2009,2,24), Date.civil(2010,2,16),
|
|
||||||
Date.civil(2011,3,8), Date.civil(2012,2,21)].each do |date|
|
|
||||||
assert_equal 'Ostatki', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Środa Popielcowa
|
|
||||||
[Date.civil(2008,2,6), Date.civil(2009,2,25), Date.civil(2010,2,17),
|
|
||||||
Date.civil(2011,3,9), Date.civil(2012,2,22)].each do |date|
|
|
||||||
assert_equal 'Środa Popielcowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Palmowa
|
|
||||||
[Date.civil(2008,3,16), Date.civil(2009,4,5), Date.civil(2010,3,28),
|
|
||||||
Date.civil(2011,4,17), Date.civil(2012,4,1)].each do |date|
|
|
||||||
assert_equal 'Niedziela Palmowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Czwartek
|
|
||||||
[Date.civil(2008,3,20), Date.civil(2009,4,9), Date.civil(2010,4,1),
|
|
||||||
Date.civil(2011,4,21), Date.civil(2012,4,5)].each do |date|
|
|
||||||
assert_equal 'Wielki Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielki Piątek
|
|
||||||
[Date.civil(2008,3,21), Date.civil(2009,4,10), Date.civil(2010,4,2),
|
|
||||||
Date.civil(2011,4,22), Date.civil(2012,4,6)].each do |date|
|
|
||||||
assert_equal 'Wielki Piątek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wielka Sobota
|
|
||||||
[Date.civil(2008,3,22), Date.civil(2009,4,11), Date.civil(2010,4,3),
|
|
||||||
Date.civil(2011,4,23), Date.civil(2012,4,7)].each do |date|
|
|
||||||
assert_equal 'Wielka Sobota', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Niedziela Wielkanocna
|
|
||||||
[Date.civil(2008,3,23), Date.civil(2009,4,12), Date.civil(2010,4,4),
|
|
||||||
Date.civil(2011,4,24), Date.civil(2012,4,8)].each do |date|
|
|
||||||
assert_equal 'Niedziela Wielkanocna', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
||||||
[Date.civil(2008,3,24), Date.civil(2009,4,13), Date.civil(2010,4,5),
|
|
||||||
Date.civil(2011,4,25), Date.civil(2012,4,9)].each do |date|
|
|
||||||
assert_equal 'Poniedziałek Wielkanocny (Lany Poniedziałek)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Zesłanie Ducha Świętego (Zielone Świątki)
|
|
||||||
[Date.civil(2008,5,11), Date.civil(2009,5,31), Date.civil(2010,5,23),
|
|
||||||
Date.civil(2011,6,12), Date.civil(2012,5,27)].each do |date|
|
|
||||||
assert_equal 'Zesłanie Ducha Świętego (Zielone Świątki)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
||||||
[Date.civil(2008,5,22), Date.civil(2009,6,11), Date.civil(2010,6,3),
|
|
||||||
Date.civil(2011,6,23), Date.civil(2012,6,7)].each do |date|
|
|
||||||
assert_equal 'Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Wniebowzięcie Najświętszej Maryi Panny & Święto Wojska Polskiego
|
|
||||||
assert_equal 'Wniebowzięcie Najświętszej Maryi Panny', (Holidays.on(Date.civil(2011,8,15), :pl)[0] || {})[:name]
|
|
||||||
assert_equal 'Święto Wojska Polskiego', (Holidays.on(Date.civil(2011,8,15), :pl)[1] || {})[:name]
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,48 +0,0 @@
|
||||||
require File.expand_path(File.dirname(__FILE__)) + '/test_helper'
|
|
||||||
|
|
||||||
class MultipleRegionsTests < Test::Unit::TestCase
|
|
||||||
|
|
||||||
def test_definition_dir
|
|
||||||
assert File.directory?(Holidays::DEFINITION_PATH)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_getting_available_paths
|
|
||||||
defs = Holidays.available(true)
|
|
||||||
assert_equal def_count, defs.size
|
|
||||||
|
|
||||||
defs.each do |f|
|
|
||||||
assert f.kind_of?(String)
|
|
||||||
assert File.exists?(f)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_getting_available_symbols
|
|
||||||
defs = Holidays.available(false)
|
|
||||||
assert_equal def_count, defs.size
|
|
||||||
|
|
||||||
defs.each { |f| assert f.kind_of?(Symbol) }
|
|
||||||
|
|
||||||
# some spot checks
|
|
||||||
assert defs.include?(:ca)
|
|
||||||
assert defs.include?(:united_nations)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def test_loading_all
|
|
||||||
Holidays.load_all
|
|
||||||
holidays = Holidays.on(Date.civil(2011, 5, 1), :any)
|
|
||||||
|
|
||||||
# at least 15 now, but there could be more in the future
|
|
||||||
assert holidays.size > 15
|
|
||||||
|
|
||||||
# some spot checks
|
|
||||||
assert holidays.any? { |h| h[:name] == 'Staatsfeiertag' } # :at
|
|
||||||
assert holidays.any? { |h| h[:name] == 'Dia do Trabalho' } # :br
|
|
||||||
assert holidays.any? { |h| h[:name] == 'Vappu' } # :fi
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def def_count
|
|
||||||
Dir.glob(Holidays::DEFINITION_PATH + '/*.rb').size
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -103,14 +103,6 @@ class HolidaysTests < Test::Unit::TestCase
|
||||||
assert_equal '2099-04-12', Holidays.easter(2099).to_s
|
assert_equal '2099-04-12', Holidays.easter(2099).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_orthodox_easter
|
|
||||||
assert_equal '2000-04-30', Holidays.orthodox_easter(2000).to_s
|
|
||||||
assert_equal '2008-04-27', Holidays.orthodox_easter(2008).to_s
|
|
||||||
assert_equal '2009-04-19', Holidays.orthodox_easter(2009).to_s
|
|
||||||
assert_equal '2011-04-24', Holidays.orthodox_easter(2011).to_s
|
|
||||||
assert_equal '2020-04-19', Holidays.orthodox_easter(2020).to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_easter_lambda
|
def test_easter_lambda
|
||||||
[Date.civil(1800,4,11), Date.civil(1899,3,31), Date.civil(1900,4,13),
|
[Date.civil(1800,4,11), Date.civil(1899,3,31), Date.civil(1900,4,13),
|
||||||
Date.civil(2008,3,21), Date.civil(2035,3,23)].each do |date|
|
Date.civil(2008,3,21), Date.civil(2035,3,23)].each do |date|
|
||||||
|
|
Loading…
Reference in a new issue