mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 13:25:19 +08:00
174 lines
5 KiB
YAML
Vendored
174 lines
5 KiB
YAML
Vendored
# 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)"
|