82 lines
2.1 KiB
YAML
82 lines
2.1 KiB
YAML
|
# Norwegian holiday definitions for the Ruby Holiday gem.
|
||
|
#
|
||
|
# Added: 20010-02-22.
|
||
|
# Sources:
|
||
|
# - http://no.wikipedia.org/wiki/Offentlig_fridag
|
||
|
# - http://www.timeanddate.com/norsk/kalender.html
|
||
|
---
|
||
|
months:
|
||
|
0:
|
||
|
- name: Fastelavn
|
||
|
regions: ["no"]
|
||
|
function: easter(year)-49
|
||
|
type: informal
|
||
|
- name: Palmesøndag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)-7
|
||
|
- name: Skjærtorsdag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)-3
|
||
|
- name: Langfredag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)-2
|
||
|
- name: 1. påskedag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)
|
||
|
- name: 2. påskedag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)+1
|
||
|
- name: Kristi Himmelfartsdag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)+39
|
||
|
- name: 1. pinsedag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)+49
|
||
|
- name: 2. pinsedag
|
||
|
regions: ["no"]
|
||
|
function: easter(year)+50
|
||
|
1:
|
||
|
- name: Nyttårsdag
|
||
|
regions: ["no"]
|
||
|
mday: 1
|
||
|
5:
|
||
|
- name: 1. mai
|
||
|
regions: ["no"]
|
||
|
mday: 1
|
||
|
- name: 17. mai
|
||
|
regions: ["no"]
|
||
|
mday: 17
|
||
|
12:
|
||
|
- name: Julaften
|
||
|
regions: ["no"]
|
||
|
mday: 24
|
||
|
type: informal
|
||
|
- name: 1. juledag
|
||
|
regions: ["no"]
|
||
|
mday: 25
|
||
|
- name: 2. juledag
|
||
|
regions: ["no"]
|
||
|
mday: 26
|
||
|
- name: Nyttårsaften
|
||
|
regions: ["no"]
|
||
|
mday: 31
|
||
|
type: informal
|
||
|
tests: |
|
||
|
{Date.civil(2010,1,1) => 'Nyttårsdag',
|
||
|
Date.civil(2010,5,1) => '1. mai',
|
||
|
Date.civil(2010,5,17) => '17. mai',
|
||
|
Date.civil(2010,12,24) => 'Julaften',
|
||
|
Date.civil(2010,12,25) => '1. juledag',
|
||
|
Date.civil(2010,12,26) => '2. juledag',
|
||
|
Date.civil(2010,12,31) => 'Nyttårsaften',
|
||
|
Date.civil(2010,2,14) => 'Fastelavn',
|
||
|
Date.civil(2010,3,28) => 'Palmesøndag',
|
||
|
Date.civil(2010,4,1) => 'Skjærtorsdag',
|
||
|
Date.civil(2010,4,2) => 'Langfredag',
|
||
|
Date.civil(2010,4,4) => '1. påskedag',
|
||
|
Date.civil(2010,4,5) => '2. påskedag',
|
||
|
Date.civil(2010,5,13) => 'Kristi Himmelfartsdag',
|
||
|
Date.civil(2010,5,23) => '1. pinsedag',
|
||
|
Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name|
|
||
|
assert_equal name, Holidays.on(date, :no, :informal)[0][:name]
|
||
|
end
|