holidays/data/is.yaml

136 lines
3.4 KiB
YAML
Raw Normal View History

2007-11-23 22:10:21 +01:00
# Icelandic holiday definitions for the Ruby Holiday gem.
2007-11-23 05:28:15 +01:00
#
# Updated: 2008-11-29.
2007-11-23 05:28:15 +01:00
# Sources:
2007-11-23 22:10:21 +01:00
# - http://www.simnet.is/gardarj/folk/days.htm#days
2007-11-23 05:28:15 +01:00
# - 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
2007-11-23 05:28:15 +01:00
---
months:
0:
2007-11-23 22:10:21 +01:00
- name: Bolludagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)-48
2007-11-23 22:10:21 +01:00
- name: Sprengidagur
regions: [is]
function: easter(year)-47
2007-11-23 22:10:21 +01:00
- name: Öskudagur
regions: [is]
function: easter(year)-46
2007-11-23 22:10:21 +01:00
- name: Pálmasunnudagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)-7
2007-11-23 22:10:21 +01:00
- name: Skírdagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)-3
2007-11-23 22:10:21 +01:00
- name: Föstudaginn langi
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)-2
2007-11-23 22:10:21 +01:00
- name: Páskadagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)
2007-11-23 22:10:21 +01:00
- name: Annar í páskum
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)+1
- name: Uppstigningardagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)+39
- name: Hvítasunnudagur
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)+49
- name: Annar í hvítasunnu
2007-11-23 05:28:15 +01:00
regions: [is]
function: easter(year)+50
2007-11-23 05:28:15 +01:00
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)
2007-11-23 05:28:15 +01:00
5:
- name: Verkalýðsdagurinn
regions: [is]
mday: 1
- name: Mæðradagurinn
regions: [is]
mday: 13
6:
2007-11-23 22:10:21 +01:00
- 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
2007-12-05 23:27:05 +01:00
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]
2007-11-23 22:10:21 +01:00
end