136 lines
3.4 KiB
YAML
136 lines
3.4 KiB
YAML
# Icelandic holiday definitions for the Ruby Holiday gem.
|
|
#
|
|
# Updated: 2008-11-29.
|
|
# Sources:
|
|
# - http://www.simnet.is/gardarj/folk/days.htm#days
|
|
# - http://www.iceland.is/history-and-culture/Traditions/IcelandicHolidays/
|
|
# - http://en.wikipedia.org/wiki/Public_holidays_in_Iceland
|
|
# - http://www.qppstudio.net/publicholidays2007/iceland.htm
|
|
---
|
|
months:
|
|
0:
|
|
- name: Bolludagur
|
|
regions: [is]
|
|
function: easter(year)-48
|
|
- name: Sprengidagur
|
|
regions: [is]
|
|
function: easter(year)-47
|
|
- name: Öskudagur
|
|
regions: [is]
|
|
function: easter(year)-46
|
|
- name: Pálmasunnudagur
|
|
regions: [is]
|
|
function: easter(year)-7
|
|
- name: Skírdagur
|
|
regions: [is]
|
|
function: easter(year)-3
|
|
- name: Föstudaginn langi
|
|
regions: [is]
|
|
function: easter(year)-2
|
|
- name: Páskadagur
|
|
regions: [is]
|
|
function: easter(year)
|
|
- name: Annar í páskum
|
|
regions: [is]
|
|
function: easter(year)+1
|
|
- name: Uppstigningardagur
|
|
regions: [is]
|
|
function: easter(year)+39
|
|
- name: Hvítasunnudagur
|
|
regions: [is]
|
|
function: easter(year)+49
|
|
- name: Annar í hvítasunnu
|
|
regions: [is]
|
|
function: easter(year)+50
|
|
1:
|
|
- name: Nýársdagur
|
|
regions: [is]
|
|
mday: 1
|
|
- name: Þrettándinn
|
|
regions: [is]
|
|
mday: 6
|
|
- name: Bóndadagur
|
|
regions: [is]
|
|
mday: 19
|
|
type: informal
|
|
2:
|
|
- name: Konudagur
|
|
regions: [is]
|
|
mday: 18
|
|
type: informal
|
|
4:
|
|
- name: Sumardagurinn fyrsti
|
|
regions: [is]
|
|
function: is_sumardagurinn_fyrsti(year)
|
|
5:
|
|
- name: Verkalýðsdagurinn
|
|
regions: [is]
|
|
mday: 1
|
|
- name: Mæðradagurinn
|
|
regions: [is]
|
|
mday: 13
|
|
6:
|
|
- name: Sjómannadagurinn
|
|
regions: [is]
|
|
mday: 3
|
|
type: informal
|
|
- name: Lýðveldisdagurinn
|
|
regions: [is]
|
|
mday: 17
|
|
8:
|
|
- name: Frídagur verslunarmanna
|
|
regions: [is]
|
|
week: 1
|
|
wday: 1
|
|
11:
|
|
- name: Dagur íslenskrar tungu
|
|
regions: [is]
|
|
mday: 16
|
|
12:
|
|
- name: Jól
|
|
regions: [is]
|
|
mday: 24
|
|
- name: Jól
|
|
regions: [is]
|
|
mday: 25
|
|
- name: Jól
|
|
regions: [is]
|
|
mday: 26
|
|
- name: Gamlárskvöld
|
|
regions: [is]
|
|
mday: 31
|
|
methods:
|
|
is_sumardagurinn_fyrsti: |
|
|
# Iceland: first day of summer (Thursday after 18 April)
|
|
def self.is_sumardagurinn_fyrsti(year)
|
|
date = Date.civil(year,4,18)
|
|
if date.wday < 4
|
|
date += (4 - date.wday)
|
|
else date
|
|
date += (11 - date.wday)
|
|
end
|
|
date
|
|
end
|
|
tests: |
|
|
{Date.civil(2007,1,1) => 'Nýársdagur',
|
|
Date.civil(2007,1,6) => 'Þrettándinn',
|
|
Date.civil(2007,1,19) => 'Bóndadagur',
|
|
Date.civil(2007,2,18) => 'Konudagur',
|
|
Date.civil(2007,4,5) => 'Skírdagur',
|
|
Date.civil(2007,4,6) => 'Föstudaginn langi',
|
|
Date.civil(2007,4,8) => 'Páskadagur',
|
|
Date.civil(2007,4,9) => 'Annar í páskum',
|
|
Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
|
|
Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
|
|
Date.civil(2007,5,17) => 'Uppstigningardagur',
|
|
Date.civil(2007,5,27) => 'Hvítasunnudagur',
|
|
Date.civil(2007,5,28) => 'Annar í hvítasunnu',
|
|
Date.civil(2007,6,3) => 'Sjómannadagurinn',
|
|
Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
|
|
Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
|
|
Date.civil(2007,12,24) => 'Jól',
|
|
Date.civil(2007,12,25) => 'Jól',
|
|
Date.civil(2007,12,26) => 'Jól',
|
|
Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
|
|
assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name]
|
|
end |