-
Notifications
You must be signed in to change notification settings - Fork 136
/
tr.yaml
174 lines (173 loc) · 5.02 KB
/
tr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Turkish holiday definitions for the Ruby Holiday gem.
#
# Updated: 2019-02-10
#
# Note:
# This holiday definition file contains pre-defined dates
# for Ramadan Feast and Sacrifice Feast from 2014 to 2019.
#
# Sources:
# - https://en.wikipedia.org/wiki/Public_holidays_in_Turkey
# - https://www.timeanddate.com/holidays/turkey/
# - https://de.wikipedia.org/wiki/Feiertage_in_der_Türkei
# - https://de.wikipedia.org/wiki/Ramadan#Beginn_und_Ende_des_Ramadans
# - https://de.wikipedia.org/wiki/Islamisches_Opferfest#Opferfest-Termine
# - https://translate.yandex.com/?lang=en-tr
# - https://de.wikibooks.org/wiki/Türkisch:_Zahlen
# - https://en.wikipedia.org/wiki/Democracy_and_National_Unity_Day
---
months:
0:
- name: Ramazan Bayramı # Ramadan Feast
regions: [tr]
function: ramadan_feast(year)
- name: Ramazan Bayramı (ikinci tatil) # Ramadan Feast, 2nd holiday
regions: [tr]
function: ramadan_feast(year)
function_modifier: 1
- name: Ramazan Bayramı (üçüncü tatil) # Ramadan Feast, 3rd holiday
regions: [tr]
function: ramadan_feast(year)
function_modifier: 2
- name: Kurban Bayramı # Sacrifice Feast
regions: [tr]
function: sacrifice_feast(year)
- name: Kurban Bayramı (ikinci tatil) # Sacrifice Feast, 2nd holiday
regions: [tr]
function: sacrifice_feast(year)
function_modifier: 1
- name: Kurban Bayramı (üçüncü tatil) # Sacrifice Feast, 3rd holiday
regions: [tr]
function: sacrifice_feast(year)
function_modifier: 2
- name: Kurban Bayramı (dördüncü tatil) # Sacrifice Feast, 4th holiday
regions: [tr]
function: sacrifice_feast(year)
function_modifier: 3
1:
- name: Yılbaşı # New Year's Day
regions: [tr]
mday: 1
4:
- name: Ulusal Egemenlik ve Çocuk Bayramı # National Sovereignty and Children's Day
regions: [tr]
mday: 23
5:
- name: Emek ve Dayanışma Günü # Labour and Solidarity Day
regions: [tr]
mday: 1
- name: Atatürk'ü Anma Gençlik ve Spor Bayramı # Commemoration of Atatürk, Youth and Sports Day
regions: [tr]
mday: 19
7:
- name: Demokrasi ve Milli Birlik Günü # Democracy and National Unity Day
regions: [tr]
mday: 15
year_ranges:
from: 2016
8:
- name: Zafer Bayramı # Victory Day
regions: [tr]
mday: 30
10:
- name: Cumhuriyet Bayramı # Republic Day
regions: [tr]
mday: 29
methods:
ramadan_feast:
arguments: year
ruby: |
begin_of_ramadan_feast = {
'2014' => Date.civil(2014, 7, 28),
'2015' => Date.civil(2015, 7, 17),
'2016' => Date.civil(2016, 7, 5),
'2017' => Date.civil(2017, 6, 25),
'2018' => Date.civil(2018, 6, 15),
'2019' => Date.civil(2019, 6, 4),
'2020' => Date.civil(2020, 5, 24)
}
begin_of_ramadan_feast[year.to_s]
sacrifice_feast:
arguments: year
ruby: |
begin_of_sacrifice_feast = {
'2014' => Date.civil(2014, 10, 4),
'2015' => Date.civil(2015, 9, 24),
'2016' => Date.civil(2016, 9, 12),
'2017' => Date.civil(2017, 9, 1),
'2018' => Date.civil(2018, 8, 21),
'2019' => Date.civil(2019, 8, 11),
'2020' => Date.civil(2020, 7, 31)
}
begin_of_sacrifice_feast[year.to_s]
tests:
- given:
date: '2017-1-1'
regions: ["tr"]
expect:
name: "Yılbaşı"
- given:
date: '2017-4-23'
regions: ["tr"]
expect:
name: "Ulusal Egemenlik ve Çocuk Bayramı"
- given:
date: '2017-5-1'
regions: ["tr"]
expect:
name: "Emek ve Dayanışma Günü"
- given:
date: '2017-5-19'
regions: ["tr"]
expect:
name: "Atatürk'ü Anma Gençlik ve Spor Bayramı"
- given:
date: '2017-8-30'
regions: ["tr"]
expect:
name: "Zafer Bayramı"
- given:
date: '2017-10-29'
regions: ["tr"]
expect:
name: "Cumhuriyet Bayramı"
- given:
date: ['2017-6-25', '2018-6-15', '2019-6-4', '2020-5-24']
regions: ["tr"]
expect:
name: "Ramazan Bayramı"
- given:
date: ['2017-6-26', '2018-6-16', '2019-6-5', '2020-5-25']
regions: ["tr"]
expect:
name: "Ramazan Bayramı (ikinci tatil)"
- given:
date: ['2017-6-27', '2018-6-17', '2019-6-6', '2020-5-26']
regions: ["tr"]
expect:
name: "Ramazan Bayramı (üçüncü tatil)"
- given:
date: '2017-7-15'
regions: ["tr"]
expect:
name: "Demokrasi ve Milli Birlik Günü"
- given:
date: ['2017-9-1', '2018-8-21', '2019-8-11', '2020-7-31']
regions: ["tr"]
expect:
name: "Kurban Bayramı"
- given:
date: ['2017-9-2', '2018-8-22', '2019-8-12', '2020-8-01']
regions: ["tr"]
expect:
name: "Kurban Bayramı (ikinci tatil)"
- given:
date: ['2017-9-3', '2018-8-23', '2019-8-13', '2020-8-02']
regions: ["tr"]
expect:
name: "Kurban Bayramı (üçüncü tatil)"
- given:
date: ['2017-9-4', '2018-8-24', '2019-8-14', '2020-8-03']
regions: ["tr"]
expect:
name: "Kurban Bayramı (dördüncü tatil)"