holidays 10.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4046bc784338ea2145744c92c8e288a4fddf9aad2ad072a9f82718644d5486bf
4
- data.tar.gz: a4b5b4ebba6f915bdf4fa9293cc3a2dc57d3206377b22693473372fdcecfe540
3
+ metadata.gz: 4bb2781ba121d283464899429145c411a25aaa5ff4a6a0ff5811424a56632655
4
+ data.tar.gz: 3c85c4273f1d23a9e62dbc570786bac1e7f9141557fe319b941f89b3644d096a
5
5
  SHA512:
6
- metadata.gz: 6081748d62b3e64344ed7b70d8a966c46c6608d3e459a89946ab73f029379589e3184177323b76b6c872118b3609372ac82dfe448f2fd13eca80e746f473e827
7
- data.tar.gz: d45a5c3020248e82fc40d73c12753e8eb85c7ef70c4a8569f59c8e069da8b7ec76ca1e449cbbb9100bea2e91354c6223f8f9a93a1365f2795e8029b97322fee0
6
+ metadata.gz: 4bbbdbf548d4dfaad1806ad22a1fbd75036148f5d822dc9623fe469c60464580615e357e1761bec427974a03c33403487478167d22a62dc91f2dffd83495eeb2
7
+ data.tar.gz: 92defd8e455e8f29075fe75354cf5348efa6d4c8d2df7ecd1c42aa2015adf8b58858284dfc4797616e2970fa862b8747e03cf33f4442d5b6f82eddf7ab5c3efe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Ruby Holidays Gem CHANGELOG
2
2
 
3
+ ## 11.1.0
4
+
5
+ * Add `Holidays.region_names` and `Holidays.region_name(region)` to expose the English name of each region ([#160](https://github.com/holidays/holidays/issues/160)). Names are the ISO 3166 English short names added in [definitions #325](https://github.com/holidays/definitions/pull/325). `region_name` returns `nil` for an unknown region. `available_regions` is unchanged.
6
+ * Update to [v8.0.1 definitions](https://github.com/holidays/definitions/releases/tag/v8.0.1). Please see the changelog for the definition details.
7
+ * Fix `gb` Christmas and Boxing Day observed dates when Christmas falls on a Sunday ([#396](https://github.com/holidays/holidays/issues/396)). Boxing Day is now observed on Monday the 26th and Christmas Day is substituted to Tuesday the 27th. Callers matching on holiday name will see these two names swap for the affected dates.
8
+ * Fix `ph` National Heroes Day when August 31st falls on a Sunday ([definitions issue-345](https://github.com/holidays/definitions/issues/345))
9
+
10
+ ## 11.0.0
11
+
12
+ * Update to [v8.0.0 definitions](https://github.com/holidays/definitions/releases/tag/v8.0.0). Please see the changelog for the definition details.
13
+ * Rename the Vietnam region code from `vi` to `vn` to follow ISO 3166-1 alpha-2 (`VI` is the US Virgin Islands, `VN` is Vietnam) ([definitions #177](https://github.com/holidays/definitions/issues/177)). This is a breaking change: callers must use `:vn` instead of `:vi`.
14
+
3
15
  ## 10.0.0
4
16
 
5
17
  * Drop support for Ruby 3.2. Supported versions are now 3.3, 3.4, 4.0, and ruby-head.
data/README.md CHANGED
@@ -243,6 +243,31 @@ Holidays.available_regions
243
243
  => [:ar, :at, ..., :sg] # this will be a big array
244
244
  ```
245
245
 
246
+ #### Return region names
247
+
248
+ Return the English name of every region:
249
+
250
+ ```ruby
251
+ Holidays.region_names
252
+ => {:ar=>"Argentina", :at=>"Austria", ..., :sg=>"Singapore"} # this will be a big hash
253
+ ```
254
+
255
+ Return the English name of a single region:
256
+
257
+ ```ruby
258
+ Holidays.region_name(:gb_eng)
259
+ => "England"
260
+ ```
261
+
262
+ Unknown regions return `nil`:
263
+
264
+ ```ruby
265
+ Holidays.region_name(:not_a_region)
266
+ => nil
267
+ ```
268
+
269
+ Names are the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) English short names where one exists. Subregions and non-country regions (stock exchanges, central banks, shipping carriers) use their common English name.
270
+
246
271
  ## Loading Custom Definitions on the fly
247
272
 
248
273
  In addition to the [provided definitions](https://github.com/holidays/definitions) you can load custom definitions file on the fly and use them immediately.
@@ -5,7 +5,6 @@ The following definition files are included in this installation:
5
5
  * generated_definitions/ar
6
6
  * generated_definitions/at
7
7
  * generated_definitions/au
8
- * generated_definitions/be
9
8
  * generated_definitions/be_fr
10
9
  * generated_definitions/be_nl
11
10
  * generated_definitions/bg
@@ -21,7 +20,6 @@ The following definition files are included in this installation:
21
20
  * generated_definitions/dk
22
21
  * generated_definitions/ecbtarget
23
22
  * generated_definitions/ee
24
- * generated_definitions/el
25
23
  * generated_definitions/es
26
24
  * generated_definitions/europe
27
25
  * generated_definitions/federalreserve
@@ -84,5 +82,5 @@ The following definition files are included in this installation:
84
82
  * generated_definitions/ups
85
83
  * generated_definitions/us
86
84
  * generated_definitions/ve
87
- * generated_definitions/vi
85
+ * generated_definitions/vn
88
86
  * generated_definitions/za
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
2
  module Holidays
3
- REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_wa, :au_tas, :au_tas_south, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_nb, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_yt, :us, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cl, :co, :cr, :cy, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath, :de_sn, :de_st, :de_be, :de_mv, :de_by_cath, :de_by_augsburg, :de_th, :de_bb, :de_hb, :de_hh, :de_ni, :de_sh, :ecbtarget, :ee, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federalreserve, :federalreservebanks, :fedex, :fi, :fr_a, :fr_m, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :gb_sct, :im, :gb_iom, :ge, :gr, :hr, :hk, :hu, :ie, :il, :in, :in_wb, :in_od, :in_tr, :in_mh, :in_ar, :in_mz, :in_br, :in_hp, :in_gj, :in_sk, :in_ts, :in_jh, :in_py, :in_kl, :in_ka, :in_jk, :in_ap, :in_cg, :in_hr, :in_mp, :in_pb, :in_nl, :in_as, :in_ga, :is, :it, :it_ve, :it_tv, :it_vr, :it_pd, :it_fi, :it_ge, :it_to, :it_rm, :it_vi, :it_bl, :it_ro, :ke, :kr, :kz, :li, :lt, :lv, :ma, :mc, :mt_mt, :mt_en, :mx, :mx_pue, :nerc, :nl, :lu, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :pe, :ph, :pl, :pt, :pt_li, :pt_po, :ro, :rs_cyrl, :rs_la, :ru, :se, :tn, :tr, :tsx, :ua, :us_fl, :us_al, :us_la, :us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_nj, :us_nc, :us_nd, :us_pa, :us_pr, :us_tn, :us_ga, :us_ms, :us_id, :us_ar, :us_tx, :us_dc, :us_md, :us_va, :us_vt, :us_ak, :us_ca, :us_me, :us_ma, :us_ne, :us_mo, :us_sc, :us_wv, :us_vi, :us_ut, :us_ri, :us_az, :us_co, :us_il, :us_mt, :us_nm, :us_ny, :us_oh, :us_mi, :us_mn, :us_nv, :us_or, :us_sd, :us_wa, :us_wi, :us_wy, :us_ia, :us_ks, :us_nh, :us_ok, :unitednations, :ups, :za, :ve, :sk, :si, :jp, :vi, :sg, :my, :th, :ng]
3
+ REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_wa, :au_tas, :au_tas_south, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_nb, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_yt, :us, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cl, :co, :cr, :cy, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath, :de_sn, :de_st, :de_be, :de_mv, :de_by_cath, :de_by_augsburg, :de_th, :de_bb, :de_hb, :de_hh, :de_ni, :de_sh, :ecbtarget, :ee, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federalreserve, :federalreservebanks, :fedex, :fi, :fr_a, :fr_m, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :gb_sct, :im, :gb_iom, :ge, :gr, :hr, :hk, :hu, :ie, :il, :in, :in_wb, :in_od, :in_tr, :in_mh, :in_ar, :in_mz, :in_br, :in_hp, :in_gj, :in_sk, :in_ts, :in_jh, :in_py, :in_kl, :in_ka, :in_jk, :in_ap, :in_cg, :in_hr, :in_mp, :in_pb, :in_nl, :in_as, :in_ga, :is, :it, :it_ve, :it_tv, :it_vr, :it_pd, :it_fi, :it_ge, :it_to, :it_rm, :it_vi, :it_bl, :it_ro, :ke, :kr, :kz, :li, :lt, :lv, :ma, :mc, :mt_mt, :mt_en, :mx, :mx_pue, :nerc, :nl, :lu, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :pe, :ph, :pl, :pt, :pt_li, :pt_po, :ro, :rs_cyrl, :rs_la, :ru, :se, :tn, :tr, :tsx, :ua, :us_fl, :us_al, :us_la, :us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_nj, :us_nc, :us_nd, :us_pa, :us_pr, :us_tn, :us_ga, :us_ms, :us_id, :us_ar, :us_tx, :us_dc, :us_md, :us_va, :us_vt, :us_ak, :us_ca, :us_me, :us_ma, :us_ne, :us_mo, :us_sc, :us_wv, :us_vi, :us_ut, :us_ri, :us_az, :us_co, :us_il, :us_mt, :us_nm, :us_ny, :us_oh, :us_mi, :us_mn, :us_nv, :us_or, :us_sd, :us_wa, :us_wi, :us_wy, :us_ia, :us_ks, :us_nh, :us_ok, :unitednations, :ups, :za, :ve, :sk, :si, :jp, :vn, :sg, :my, :th, :ng]
4
4
 
5
- PARENT_REGION_LOOKUP = {ar: :ar, at: :at, au: :au, au_nsw: :au, au_vic: :au, au_qld: :au, au_nt: :au, au_act: :au, au_sa: :au, au_wa: :au, au_tas: :au, au_tas_south: :au, au_qld_cairns: :au, au_qld_brisbane: :au, au_tas_north: :au, au_vic_melbourne: :au, be_fr: :be_fr, be_nl: :be_nl, br: :br, bg_en: :bg, bg_bg: :bg, ca: :ca, ca_qc: :ca, ca_ab: :ca, ca_sk: :ca, ca_on: :ca, ca_bc: :ca, ca_nb: :ca, ca_mb: :ca, ca_ns: :ca, ca_pe: :ca, ca_nl: :ca, ca_nt: :ca, ca_nu: :ca, ca_yt: :ca, us: :us, ch_zh: :ch, ch_be: :ch, ch_lu: :ch, ch_ur: :ch, ch_sz: :ch, ch_ow: :ch, ch_nw: :ch, ch_gl: :ch, ch_zg: :ch, ch_fr: :ch, ch_so: :ch, ch_bs: :ch, ch_bl: :ch, ch_sh: :ch, ch_ar: :ch, ch_ai: :ch, ch_sg: :ch, ch_gr: :ch, ch_ag: :ch, ch_tg: :ch, ch_ti: :ch, ch_vd: :ch, ch_ne: :ch, ch_ge: :ch, ch_ju: :ch, ch_vs: :ch, ch: :ch, cl: :cl, co: :co, cr: :cr, cy: :cy, cz: :cz, dk: :dk, de: :de, de_bw: :de, de_by: :de, de_he: :de, de_nw: :de, de_rp: :de, de_sl: :de, de_sn_sorbian: :de, de_th_cath: :de, de_sn: :de, de_st: :de, de_be: :de, de_mv: :de, de_by_cath: :de, de_by_augsburg: :de, de_th: :de, de_bb: :de, de_hb: :de, de_hh: :de, de_ni: :de, de_sh: :de, ecbtarget: :ecbtarget, ee: :ee, es_pv: :es, es_na: :es, es_an: :es, es_ib: :es, es_cm: :es, es_mu: :es, es_m: :es, es_ar: :es, es_cl: :es, es_cn: :es, es_lo: :es, es_ga: :es, es_ce: :es, es_o: :es, es_ex: :es, es: :es, es_ct: :es, es_v: :es, es_vc: :es, federalreserve: :federalreserve, federalreservebanks: :federalreservebanks, fedex: :fedex, fi: :fi, fr_a: :fr, fr_m: :fr, fr: :fr, gb: :gb, gb_eng: :gb, gb_wls: :gb, gb_eaw: :gb, gb_nir: :gb, gb_con: :gb, je: :gb, gb_jsy: :gb, gg: :gb, gb_gsy: :gb, gb_sct: :gb, im: :gb, gb_iom: :gb, ge: :ge, gr: :gr, hr: :hr, hk: :hk, hu: :hu, ie: :ie, il: :il, in: :in, in_wb: :in, in_od: :in, in_tr: :in, in_mh: :in, in_ar: :in, in_mz: :in, in_br: :in, in_hp: :in, in_gj: :in, in_sk: :in, in_ts: :in, in_jh: :in, in_py: :in, in_kl: :in, in_ka: :in, in_jk: :in, in_ap: :in, in_cg: :in, in_hr: :in, in_mp: :in, in_pb: :in, in_nl: :in, in_as: :in, in_ga: :in, is: :is, it: :it, it_ve: :it, it_tv: :it, it_vr: :it, it_pd: :it, it_fi: :it, it_ge: :it, it_to: :it, it_rm: :it, it_vi: :it, it_bl: :it, it_ro: :it, ke: :ke, kr: :kr, kz: :kz, li: :li, lt: :lt, lv: :lv, ma: :ma, mc: :mc, mt_mt: :mt_mt, mt_en: :mt_en, mx: :mx, mx_pue: :mx, nerc: :nerc, nl: :nl, lu: :lu, no: :no, nyse: :nyse, nz: :nz, nz_sl: :nz, nz_we: :nz, nz_ak: :nz, nz_nl: :nz, nz_ne: :nz, nz_ot: :nz, nz_ta: :nz, nz_sc: :nz, nz_hb: :nz, nz_mb: :nz, nz_ca: :nz, nz_ch: :nz, nz_wl: :nz, pe: :pe, ph: :ph, pl: :pl, pt: :pt, pt_li: :pt, pt_po: :pt, ro: :ro, rs_cyrl: :rs_cyrl, rs_la: :rs_la, ru: :ru, se: :se, tn: :tn, tr: :tr, tsx: :tsx, ua: :ua, us_fl: :us, us_al: :us, us_la: :us, us_ct: :us, us_de: :us, us_gu: :us, us_hi: :us, us_in: :us, us_ky: :us, us_nj: :us, us_nc: :us, us_nd: :us, us_pa: :us, us_pr: :us, us_tn: :us, us_ga: :us, us_ms: :us, us_id: :us, us_ar: :us, us_tx: :us, us_dc: :us, us_md: :us, us_va: :us, us_vt: :us, us_ak: :us, us_ca: :us, us_me: :us, us_ma: :us, us_ne: :us, us_mo: :us, us_sc: :us, us_wv: :us, us_vi: :us, us_ut: :us, us_ri: :us, us_az: :us, us_co: :us, us_il: :us, us_mt: :us, us_nm: :us, us_ny: :us, us_oh: :us, us_mi: :us, us_mn: :us, us_nv: :us, us_or: :us, us_sd: :us, us_wa: :us, us_wi: :us, us_wy: :us, us_ia: :us, us_ks: :us, us_nh: :us, us_ok: :us, unitednations: :unitednations, ups: :ups, za: :za, ve: :southamerica, sk: :europe, si: :europe, jp: :jp, vi: :vi, sg: :sg, my: :my, th: :th, ng: :ng}
5
+ PARENT_REGION_LOOKUP = {ar: :ar, at: :at, au: :au, au_nsw: :au, au_vic: :au, au_qld: :au, au_nt: :au, au_act: :au, au_sa: :au, au_wa: :au, au_tas: :au, au_tas_south: :au, au_qld_cairns: :au, au_qld_brisbane: :au, au_tas_north: :au, au_vic_melbourne: :au, be_fr: :be_fr, be_nl: :be_nl, br: :br, bg_en: :bg, bg_bg: :bg, ca: :ca, ca_qc: :ca, ca_ab: :ca, ca_sk: :ca, ca_on: :ca, ca_bc: :ca, ca_nb: :ca, ca_mb: :ca, ca_ns: :ca, ca_pe: :ca, ca_nl: :ca, ca_nt: :ca, ca_nu: :ca, ca_yt: :ca, us: :us, ch_zh: :ch, ch_be: :ch, ch_lu: :ch, ch_ur: :ch, ch_sz: :ch, ch_ow: :ch, ch_nw: :ch, ch_gl: :ch, ch_zg: :ch, ch_fr: :ch, ch_so: :ch, ch_bs: :ch, ch_bl: :ch, ch_sh: :ch, ch_ar: :ch, ch_ai: :ch, ch_sg: :ch, ch_gr: :ch, ch_ag: :ch, ch_tg: :ch, ch_ti: :ch, ch_vd: :ch, ch_ne: :ch, ch_ge: :ch, ch_ju: :ch, ch_vs: :ch, ch: :ch, cl: :cl, co: :co, cr: :cr, cy: :cy, cz: :cz, dk: :dk, de: :de, de_bw: :de, de_by: :de, de_he: :de, de_nw: :de, de_rp: :de, de_sl: :de, de_sn_sorbian: :de, de_th_cath: :de, de_sn: :de, de_st: :de, de_be: :de, de_mv: :de, de_by_cath: :de, de_by_augsburg: :de, de_th: :de, de_bb: :de, de_hb: :de, de_hh: :de, de_ni: :de, de_sh: :de, ecbtarget: :ecbtarget, ee: :ee, es_pv: :es, es_na: :es, es_an: :es, es_ib: :es, es_cm: :es, es_mu: :es, es_m: :es, es_ar: :es, es_cl: :es, es_cn: :es, es_lo: :es, es_ga: :es, es_ce: :es, es_o: :es, es_ex: :es, es: :es, es_ct: :es, es_v: :es, es_vc: :es, federalreserve: :federalreserve, federalreservebanks: :federalreservebanks, fedex: :fedex, fi: :fi, fr_a: :fr, fr_m: :fr, fr: :fr, gb: :gb, gb_eng: :gb, gb_wls: :gb, gb_eaw: :gb, gb_nir: :gb, gb_con: :gb, je: :gb, gb_jsy: :gb, gg: :gb, gb_gsy: :gb, gb_sct: :gb, im: :gb, gb_iom: :gb, ge: :ge, gr: :gr, hr: :hr, hk: :hk, hu: :hu, ie: :ie, il: :il, in: :in, in_wb: :in, in_od: :in, in_tr: :in, in_mh: :in, in_ar: :in, in_mz: :in, in_br: :in, in_hp: :in, in_gj: :in, in_sk: :in, in_ts: :in, in_jh: :in, in_py: :in, in_kl: :in, in_ka: :in, in_jk: :in, in_ap: :in, in_cg: :in, in_hr: :in, in_mp: :in, in_pb: :in, in_nl: :in, in_as: :in, in_ga: :in, is: :is, it: :it, it_ve: :it, it_tv: :it, it_vr: :it, it_pd: :it, it_fi: :it, it_ge: :it, it_to: :it, it_rm: :it, it_vi: :it, it_bl: :it, it_ro: :it, ke: :ke, kr: :kr, kz: :kz, li: :li, lt: :lt, lv: :lv, ma: :ma, mc: :mc, mt_mt: :mt_mt, mt_en: :mt_en, mx: :mx, mx_pue: :mx, nerc: :nerc, nl: :nl, lu: :lu, no: :no, nyse: :nyse, nz: :nz, nz_sl: :nz, nz_we: :nz, nz_ak: :nz, nz_nl: :nz, nz_ne: :nz, nz_ot: :nz, nz_ta: :nz, nz_sc: :nz, nz_hb: :nz, nz_mb: :nz, nz_ca: :nz, nz_ch: :nz, nz_wl: :nz, pe: :pe, ph: :ph, pl: :pl, pt: :pt, pt_li: :pt, pt_po: :pt, ro: :ro, rs_cyrl: :rs_cyrl, rs_la: :rs_la, ru: :ru, se: :se, tn: :tn, tr: :tr, tsx: :tsx, ua: :ua, us_fl: :us, us_al: :us, us_la: :us, us_ct: :us, us_de: :us, us_gu: :us, us_hi: :us, us_in: :us, us_ky: :us, us_nj: :us, us_nc: :us, us_nd: :us, us_pa: :us, us_pr: :us, us_tn: :us, us_ga: :us, us_ms: :us, us_id: :us, us_ar: :us, us_tx: :us, us_dc: :us, us_md: :us, us_va: :us, us_vt: :us, us_ak: :us, us_ca: :us, us_me: :us, us_ma: :us, us_ne: :us, us_mo: :us, us_sc: :us, us_wv: :us, us_vi: :us, us_ut: :us, us_ri: :us, us_az: :us, us_co: :us, us_il: :us, us_mt: :us, us_nm: :us, us_ny: :us, us_oh: :us, us_mi: :us, us_mn: :us, us_nv: :us, us_or: :us, us_sd: :us, us_wa: :us, us_wi: :us, us_wy: :us, us_ia: :us, us_ks: :us, us_nh: :us, us_ok: :us, unitednations: :unitednations, ups: :ups, za: :za, ve: :southamerica, sk: :europe, si: :europe, jp: :jp, vn: :vn, sg: :sg, my: :my, th: :th, ng: :ng}
6
+
7
+ REGION_NAMES = {:ar => "Argentina", :at => "Austria", :au => "Australia", :au_act => "Australian Capital Territory", :au_nsw => "New South Wales", :au_nt => "Northern Territory", :au_qld => "Queensland", :au_qld_brisbane => "Brisbane", :au_qld_cairns => "Cairns", :au_sa => "South Australia", :au_tas => "Tasmania", :au_tas_north => "Northern Tasmania", :au_tas_south => "Southern Tasmania", :au_vic => "Victoria", :au_vic_melbourne => "Melbourne", :au_wa => "Western Australia", :be_fr => "Belgium (French)", :be_nl => "Belgium (Dutch)", :br => "Brazil", :bg_bg => "Bulgaria", :bg_en => "Bulgaria", :ca => "Canada", :ca_ab => "Alberta", :ca_bc => "British Columbia", :ca_mb => "Manitoba", :ca_nb => "New Brunswick", :ca_nl => "Newfoundland and Labrador", :ca_ns => "Nova Scotia", :ca_nt => "Northwest Territories", :ca_nu => "Nunavut", :ca_on => "Ontario", :ca_pe => "Prince Edward Island", :ca_qc => "Quebec", :ca_sk => "Saskatchewan", :ca_yt => "Yukon", :us => "United States", :ch => "Switzerland", :ch_ag => "Aargau", :ch_ai => "Appenzell Innerrhoden", :ch_ar => "Appenzell Ausserrhoden", :ch_be => "Bern", :ch_bl => "Basel-Landschaft", :ch_bs => "Basel-Stadt", :ch_fr => "Fribourg", :ch_ge => "Genève", :ch_gl => "Glarus", :ch_gr => "Graubünden", :ch_ju => "Jura", :ch_lu => "Luzern", :ch_ne => "Neuchâtel", :ch_nw => "Nidwalden", :ch_ow => "Obwalden", :ch_sg => "Sankt Gallen", :ch_sh => "Schaffhausen", :ch_so => "Solothurn", :ch_sz => "Schwyz", :ch_tg => "Thurgau", :ch_ti => "Ticino", :ch_ur => "Uri", :ch_vd => "Vaud", :ch_vs => "Valais", :ch_zg => "Zug", :ch_zh => "Zürich", :cl => "Chile", :co => "Colombia", :cr => "Costa Rica", :cy => "Cyprus", :cz => "Czechia", :dk => "Denmark", :de => "Germany", :de_bb => "Brandenburg", :de_be => "Berlin", :de_bw => "Baden-Württemberg", :de_by => "Bayern", :de_by_augsburg => "Augsburg (Bayern)", :de_by_cath => "Bayern (Catholic regions)", :de_hb => "Bremen", :de_he => "Hessen", :de_hh => "Hamburg", :de_mv => "Mecklenburg-Vorpommern", :de_ni => "Niedersachsen", :de_nw => "Nordrhein-Westfalen", :de_rp => "Rheinland-Pfalz", :de_sh => "Schleswig-Holstein", :de_sl => "Saarland", :de_sn => "Sachsen", :de_sn_sorbian => "Sachsen (Sorbian regions)", :de_st => "Sachsen-Anhalt", :de_th => "Thüringen", :de_th_cath => "Thüringen (Catholic regions)", :ecbtarget => "ECB TARGET (European Central Bank)", :ee => "Estonia", :es => "Spain", :es_an => "Andalucía", :es_ar => "Aragón", :es_ce => "Ceuta", :es_cl => "Castilla y León", :es_cm => "Castilla-La Mancha", :es_cn => "Canary Islands", :es_ct => "Cataluña", :es_ex => "Extremadura", :es_ga => "Galicia", :es_ib => "Islas Baleares", :es_lo => "Rioja, La", :es_m => "Madrid", :es_mu => "Murcia", :es_na => "Navarra", :es_o => "Asturias", :es_pv => "País Vasco", :es_v => "Valencia/València", :es_vc => "Comunidad Valenciana", :federalreserve => "Federal Reserve", :federalreservebanks => "Federal Reserve Banks", :fedex => "FedEx", :fi => "Finland", :fr => "France", :fr_a => "Alsace", :fr_m => "Moselle", :gb => "United Kingdom", :gb_con => "Cornwall", :gb_eaw => "England and Wales", :gb_eng => "England", :gb_gsy => "Guernsey", :gb_iom => "Isle of Man", :gb_jsy => "Jersey", :gb_nir => "Northern Ireland", :gb_sct => "Scotland", :gb_wls => "Wales", :gg => "Guernsey", :im => "Isle of Man", :je => "Jersey", :ge => "Georgia", :gr => "Greece", :hr => "Croatia", :hk => "Hong Kong", :hu => "Hungary", :ie => "Ireland", :il => "Israel", :in => "India", :in_ap => "Andhra Pradesh", :in_ar => "Arunachal Pradesh", :in_as => "Assam", :in_br => "Bihar", :in_cg => "Chhattisgarh", :in_ga => "Goa", :in_gj => "Gujarat", :in_hp => "Himachal Pradesh", :in_hr => "Haryana", :in_jh => "Jharkhand", :in_jk => "Jammu and Kashmir", :in_ka => "Karnataka", :in_kl => "Kerala", :in_mh => "Maharashtra", :in_mp => "Madhya Pradesh", :in_mz => "Mizoram", :in_nl => "Nagaland", :in_od => "Odisha", :in_pb => "Punjab", :in_py => "Pondicherry", :in_sk => "Sikkim", :in_tr => "Tripura", :in_ts => "तेलंगाना", :in_wb => "West Bengal", :is => "Iceland", :it => "Italy", :it_bl => "Belluno", :it_fi => "Firenze", :it_ge => "Genova", :it_pd => "Padova", :it_rm => "Roma", :it_ro => "Rovigo", :it_to => "Torino", :it_tv => "Treviso", :it_ve => "Venezia", :it_vi => "Vicenza", :it_vr => "Verona", :ke => "Kenya", :kr => "South Korea", :kz => "Kazakhstan", :li => "Liechtenstein", :lt => "Lithuania", :lv => "Latvia", :ma => "Morocco", :mc => "Monaco", :mt_mt => "Malta", :mt_en => "Malta", :mx => "Mexico", :mx_pue => "Puebla", :nerc => "North American Electric Reliability Corporation", :nl => "Netherlands", :lu => "Luxembourg", :no => "Norway", :nyse => "New York Stock Exchange", :nz => "New Zealand", :nz_ak => "Auckland", :nz_ca => "Canterbury", :nz_ch => "Chatham Islands", :nz_hb => "Hawke's Bay", :nz_mb => "Marlborough", :nz_ne => "Nelson", :nz_nl => "Northland", :nz_ot => "Otago", :nz_sc => "South Canterbury", :nz_sl => "Southland", :nz_ta => "Taranaki", :nz_we => "Wellington", :nz_wl => "Westland", :pe => "Peru", :ph => "Philippines", :pl => "Poland", :pt => "Portugal", :pt_li => "Lisbon", :pt_po => "Porto", :ro => "Romania", :rs_cyrl => "Serbia", :rs_la => "Serbia", :ru => "Russian Federation", :se => "Sweden", :tn => "Tunisia", :tr => "Türkiye", :tsx => "Toronto Stock Exchange", :ua => "Ukraine", :us_ak => "Alaska", :us_al => "Alabama", :us_ar => "Arkansas", :us_az => "Arizona", :us_ca => "California", :us_co => "Colorado", :us_ct => "Connecticut", :us_dc => "District of Columbia", :us_de => "Delaware", :us_fl => "Florida", :us_ga => "Georgia", :us_gu => "Guam", :us_hi => "Hawaii", :us_ia => "Iowa", :us_id => "Idaho", :us_il => "Illinois", :us_in => "Indiana", :us_ks => "Kansas", :us_ky => "Kentucky", :us_la => "Louisiana", :us_ma => "Massachusetts", :us_md => "Maryland", :us_me => "Maine", :us_mi => "Michigan", :us_mn => "Minnesota", :us_mo => "Missouri", :us_ms => "Mississippi", :us_mt => "Montana", :us_nc => "North Carolina", :us_nd => "North Dakota", :us_ne => "Nebraska", :us_nh => "New Hampshire", :us_nj => "New Jersey", :us_nm => "New Mexico", :us_nv => "Nevada", :us_ny => "New York", :us_oh => "Ohio", :us_ok => "Oklahoma", :us_or => "Oregon", :us_pa => "Pennsylvania", :us_pr => "Puerto Rico", :us_ri => "Rhode Island", :us_sc => "South Carolina", :us_sd => "South Dakota", :us_tn => "Tennessee", :us_tx => "Texas", :us_ut => "Utah", :us_va => "Virginia", :us_vi => "Virgin Islands, U.S.", :us_vt => "Vermont", :us_wa => "Washington", :us_wi => "Wisconsin", :us_wv => "West Virginia", :us_wy => "Wyoming", :unitednations => "United Nations", :ups => "UPS", :za => "South Africa", :ve => "Venezuela", :sk => "Slovakia", :si => "Slovenia", :jp => "Japan", :vn => "Vietnam", :sg => "Singapore", :my => "Malaysia", :th => "Thailand", :ng => "Nigeria"}
6
8
  end
@@ -383,8 +383,8 @@ module Holidays
383
383
  {:mday => 26, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "San Esteban", :regions => [:es_ib, :es_ct]},
384
384
  {:mday => 25, :name => "Noël", :regions => [:fr]},
385
385
  {:mday => 26, :name => "Saint-Étienne", :regions => [:fr_a, :fr_m]},
386
- {:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:gb]},
387
- {:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:gb]},
386
+ {:mday => 25, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:gb]},
387
+ {:mday => 26, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:gb]},
388
388
  {:mday => 25, :name => "Χριστούγεννα", :regions => [:gr]},
389
389
  {:mday => 26, :name => "Δεύτερη ημέρα των Χριστουγέννων", :regions => [:gr]},
390
390
  {:mday => 25, :name => "Božić", :regions => [:hr]},
@@ -37,8 +37,8 @@ module Holidays
37
37
  11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]},
38
38
  {:mday => 30, :year_ranges => { :until => 2006 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "St. Andrew's Day", :regions => [:gb_sct]},
39
39
  {:mday => 30, :year_ranges => { :from => 2007 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "St. Andrew's Day", :regions => [:gb_sct]}],
40
- 12 => [{:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:gb]},
41
- {:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:gb]}]
40
+ 12 => [{:mday => 25, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:gb]},
41
+ {:mday => 26, :observed => "to_tuesday_if_sunday_or_monday_if_saturday(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:gb]}]
42
42
  }
43
43
  end
44
44
 
@@ -35,11 +35,7 @@ module Holidays
35
35
  {
36
36
  "ph_heroes_day(year)" => Proc.new { |year|
37
37
  date = Date.new(year, 8, -1)
38
-
39
- if date.wday != 1
40
- date -= date.wday - 1
41
- end
42
-
38
+ date -= (date.wday - 1) % 7
43
39
  date
44
40
  },
45
41
 
@@ -2,21 +2,21 @@
2
2
  module Holidays
3
3
  # This file is generated by the Ruby Holidays gem.
4
4
  #
5
- # Definitions loaded: definitions/vi.yaml
5
+ # Definitions loaded: definitions/vn.yaml
6
6
  #
7
7
  # All the definitions are available at https://github.com/holidays/holidays
8
- module VI # :nodoc:
8
+ module VN # :nodoc:
9
9
  def self.defined_regions
10
- [:vi]
10
+ [:vn]
11
11
  end
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 1 => [{:mday => 1, :name => "Tết dương lịch", :regions => [:vi]}],
16
- 3 => [{:mday => 10, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "Giỗ tổ Hùng Vương", :regions => [:vi]}],
17
- 4 => [{:mday => 30, :name => "Ngày Giải phóng miền Nam, thống nhất đất nước", :regions => [:vi]}],
18
- 5 => [{:mday => 1, :name => "Ngày Quốc tế Lao động", :regions => [:vi]}],
19
- 9 => [{:mday => 2, :name => "Quốc khánh", :regions => [:vi]}]
15
+ 1 => [{:mday => 1, :name => "Tết dương lịch", :regions => [:vn]}],
16
+ 3 => [{:mday => 10, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "Giỗ tổ Hùng Vương", :regions => [:vn]}],
17
+ 4 => [{:mday => 30, :name => "Ngày Giải phóng miền Nam, thống nhất đất nước", :regions => [:vn]}],
18
+ 5 => [{:mday => 1, :name => "Ngày Quốc tế Lao động", :regions => [:vn]}],
19
+ 9 => [{:mday => 2, :name => "Quốc khánh", :regions => [:vn]}]
20
20
  }
21
21
  end
22
22
 
@@ -500,7 +500,7 @@ module Holidays
500
500
  # table and uses it in the calculation
501
501
  CALENDAR_YEAR_INFO_MAP = {
502
502
  kr: KOREAN_LUNAR_YEAR_INFO,
503
- vi: VIETNAMESE_LUNAR_YEAR_INFO,
503
+ vn: VIETNAMESE_LUNAR_YEAR_INFO,
504
504
  hk: CHINESE_LUNAR_YEAR_INFO,
505
505
  }.freeze
506
506
 
@@ -84,6 +84,14 @@ module Holidays
84
84
  date
85
85
  end
86
86
 
87
+ def to_the_weekday_after(date)
88
+ to_monday_if_sunday(to_monday_if_sunday(date) + 1)
89
+ end
90
+
91
+ def to_the_second_weekday_after(date)
92
+ to_monday_if_sunday(to_the_weekday_after(date) + 1)
93
+ end
94
+
87
95
  def to_previous_day_if_leap_year(date)
88
96
  date -= 1 if ::Date.gregorian_leap?(date.year)
89
97
  date
@@ -27,6 +27,7 @@ module Holidays
27
27
  all_rules_by_month = {}
28
28
  all_custom_methods = {}
29
29
  all_tests = []
30
+ all_region_names = {}
30
31
 
31
32
  files.flatten!
32
33
 
@@ -51,11 +52,19 @@ module Holidays
51
52
  all_custom_methods.merge!(custom_methods)
52
53
 
53
54
  all_tests += @test_parser.call(definition_file['tests'])
55
+
56
+ region_names = definition_file['region_names']
57
+ if region_names
58
+ symbolized_region_names = region_names.each_with_object({}) do |(region, name), hash|
59
+ hash[region.to_sym] = name
60
+ end
61
+ all_region_names.merge!(symbolized_region_names)
62
+ end
54
63
  end
55
64
 
56
65
  all_regions.flatten!.uniq!
57
66
 
58
- [all_regions, all_rules_by_month, all_custom_methods, all_tests]
67
+ [all_regions, all_rules_by_month, all_custom_methods, all_tests, all_region_names]
59
68
  end
60
69
 
61
70
  def generate_definition_source(module_name, files, regions, rules_by_month, custom_methods, tests)
@@ -105,7 +114,7 @@ module Holidays
105
114
  rule[:year_ranges][:between] = Range.new(start_year, end_year)
106
115
  end
107
116
 
108
- rule[:regions] = rule[:regions].collect { |r| r.to_sym }
117
+ rule[:regions] = rule[:regions].collect(&:to_sym)
109
118
  regions << rule[:regions]
110
119
 
111
120
  exists = false
@@ -200,7 +209,7 @@ module Holidays
200
209
  if method = @custom_methods_repository.find(function_id)
201
210
  method.parameters.collect { |arg| arg[1] }
202
211
  elsif method = parsed_custom_methods[function_id]
203
- method.arguments.collect { |arg| arg.to_sym }
212
+ method.arguments.collect(&:to_sym)
204
213
  else
205
214
  raise ArgumentError, "Unknown function '#{function_id}'. It must either be a built-in method or be defined in the 'methods' section of a definition file."
206
215
  end
@@ -6,7 +6,7 @@ module Holidays
6
6
  # holiday definitions, but that does not make these countries subregions of one another.
7
7
  NORTH_AMERICA_REGIONS = %i[ca mx us].freeze
8
8
 
9
- def call(regions)
9
+ def call(regions, region_names = {})
10
10
  validate!(regions)
11
11
 
12
12
  <<-EOF
@@ -15,6 +15,8 @@ module Holidays
15
15
  REGIONS = #{to_array(regions)}
16
16
 
17
17
  PARENT_REGION_LOOKUP = #{generate_parent_lookup(regions)}
18
+
19
+ REGION_NAMES = #{generate_region_names(region_names)}
18
20
  end
19
21
  EOF
20
22
  end
@@ -50,6 +52,14 @@ EOF
50
52
  pairs = lookup.map { |k, v| "#{k}: :#{v}" }.join(", ")
51
53
  "{#{pairs}}"
52
54
  end
55
+
56
+ # Symbol keys and string values are emitted via inspect so the literal
57
+ # round-trips exactly: YAML-reserved keys like :no stay symbols and
58
+ # values with quotes or commas are escaped rather than breaking the hash.
59
+ def generate_region_names(region_names)
60
+ pairs = region_names.map { |sym, name| "#{sym.inspect} => #{name.inspect}" }.join(", ")
61
+ "{#{pairs}}"
62
+ end
53
63
  end
54
64
  end
55
65
  end
@@ -10,17 +10,19 @@ module Holidays
10
10
  raise ArgumentError unless cache_data
11
11
  raise ArgumentError unless start_date && end_date
12
12
 
13
- @cache_range[options] = start_date..end_date
14
- @cache[options] = cache_data.group_by { |holiday| holiday[:date] }
13
+ key = normalize(options)
14
+ @cache_range[key] = start_date..end_date
15
+ @cache[key] = cache_data.group_by { |holiday| holiday[:date] }
15
16
  end
16
17
 
17
18
  def find(start_date, end_date, options)
18
19
  return nil unless in_cache_range?(start_date, end_date, options)
19
20
 
21
+ key = normalize(options)
20
22
  if start_date == end_date
21
- @cache[options].fetch(start_date, [])
23
+ @cache[key].fetch(start_date, [])
22
24
  else
23
- @cache[options].select do |date, holidays|
25
+ @cache[key].select do |date, holidays|
24
26
  date >= start_date && date <= end_date
25
27
  end.flat_map { |date, holidays| holidays }
26
28
  end
@@ -33,8 +35,12 @@ module Holidays
33
35
 
34
36
  private
35
37
 
38
+ def normalize(options)
39
+ Array(options).flatten.map(&:to_sym).uniq.sort
40
+ end
41
+
36
42
  def in_cache_range?(start_date, end_date, options)
37
- range = @cache_range[options]
43
+ range = @cache_range[normalize(options)]
38
44
  if range
39
45
  range.begin <= start_date && range.end >= end_date
40
46
  else
@@ -22,7 +22,7 @@ module Holidays
22
22
  def find_wildcard_base(region)
23
23
  r = region.to_s
24
24
 
25
- if r =~ /_$/
25
+ if /_$/.match?(r)
26
26
  base = r.split('_').first
27
27
  else
28
28
  base = r
@@ -35,7 +35,7 @@ module Holidays
35
35
  if regions.empty?
36
36
  regions = [:any]
37
37
  else
38
- regions = regions.collect { |r| r.to_sym }
38
+ regions = regions.collect(&:to_sym)
39
39
  end
40
40
 
41
41
  validate!(regions)
@@ -34,7 +34,7 @@ module Holidays
34
34
  end
35
35
  end
36
36
 
37
- holidays.sort{|a, b| a[:date] <=> b[:date] }
37
+ holidays.sort_by { |a| a[:date] }
38
38
  end
39
39
 
40
40
  private
@@ -9,7 +9,7 @@ module Holidays
9
9
  # When an underscore is encountered, derive the parent regions
10
10
  # symbol and check for both.
11
11
  requested = requested.collect do |r|
12
- if r.to_s =~ /_/
12
+ if r.to_s.include?('_')
13
13
  chunks = r.to_s.split('_')
14
14
 
15
15
  chunks.length.downto(1).map do |num|
@@ -1,3 +1,3 @@
1
1
  module Holidays
2
- VERSION = '10.0.0'
2
+ VERSION = '11.1.0'
3
3
  end
data/lib/holidays.rb CHANGED
@@ -89,8 +89,16 @@ module Holidays
89
89
  Holidays::REGIONS
90
90
  end
91
91
 
92
+ def region_names
93
+ Holidays::REGION_NAMES
94
+ end
95
+
96
+ def region_name(region)
97
+ Holidays::REGION_NAMES[region]
98
+ end
99
+
92
100
  def load_custom(*files)
93
- regions, rules_by_month, custom_methods, _ = Factory::Definition.file_parser.parse_definition_files(files)
101
+ regions, rules_by_month, custom_methods, _, _ = Factory::Definition.file_parser.parse_definition_files(files)
94
102
 
95
103
  # Capture source code before converting entities to Procs so the merger
96
104
  # can detect genuine conflicts (same name, different logic).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holidays
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.0
4
+ version: 11.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
@@ -110,7 +110,6 @@ files:
110
110
  - lib/generated_definitions/ar.rb
111
111
  - lib/generated_definitions/at.rb
112
112
  - lib/generated_definitions/au.rb
113
- - lib/generated_definitions/be.rb
114
113
  - lib/generated_definitions/be_fr.rb
115
114
  - lib/generated_definitions/be_nl.rb
116
115
  - lib/generated_definitions/bg.rb
@@ -126,7 +125,6 @@ files:
126
125
  - lib/generated_definitions/dk.rb
127
126
  - lib/generated_definitions/ecbtarget.rb
128
127
  - lib/generated_definitions/ee.rb
129
- - lib/generated_definitions/el.rb
130
128
  - lib/generated_definitions/es.rb
131
129
  - lib/generated_definitions/europe.rb
132
130
  - lib/generated_definitions/federalreserve.rb
@@ -189,7 +187,7 @@ files:
189
187
  - lib/generated_definitions/ups.rb
190
188
  - lib/generated_definitions/us.rb
191
189
  - lib/generated_definitions/ve.rb
192
- - lib/generated_definitions/vi.rb
190
+ - lib/generated_definitions/vn.rb
193
191
  - lib/generated_definitions/za.rb
194
192
  - lib/holidays.rb
195
193
  - lib/holidays/core_extensions/date.rb
@@ -1,42 +0,0 @@
1
- # encoding: utf-8
2
- module Holidays
3
- # This file is generated by the Ruby Holidays gem.
4
- #
5
- # Definitions loaded: definitions/be.yaml
6
- #
7
- # To use the definitions in this file, load it right after you load the
8
- # Holiday gem:
9
- #
10
- # require 'holidays'
11
- # require 'generated_definitions/be'
12
- #
13
- # All the definitions are available at https://github.com/holidays/holidays
14
- module BE # :nodoc:
15
- def self.defined_regions
16
- [:be]
17
- end
18
-
19
- def self.holidays_by_month
20
- {
21
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "Pâques", :regions => [:be]},
22
- {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Lundi de Pâques", :regions => [:be]},
23
- {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "Ascension", :regions => [:be]},
24
- {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Pentecôte", :regions => [:be]},
25
- {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "Lundi de Pentecôte", :regions => [:be]}],
26
- 1 => [{:mday => 1, :name => "Jour de l'an", :regions => [:be]}],
27
- 5 => [{:mday => 1, :name => "Fête du travail", :regions => [:be]}],
28
- 7 => [{:mday => 21, :name => "Fête nationale", :regions => [:be]}],
29
- 8 => [{:mday => 15, :name => "Assomption", :regions => [:be]}],
30
- 11 => [{:mday => 1, :name => "Toussaint", :regions => [:be]},
31
- {:mday => 11, :name => "Armistice 1918", :regions => [:be]}],
32
- 12 => [{:mday => 25, :name => "Noël", :regions => [:be]}]
33
- }
34
- end
35
-
36
- def self.custom_methods
37
- {
38
-
39
- }
40
- end
41
- end
42
- end
@@ -1,38 +0,0 @@
1
- # encoding: utf-8
2
- module Holidays
3
- # This file is generated by the Ruby Holidays gem.
4
- #
5
- # Definitions loaded: definitions/el.yaml
6
- #
7
- # All the definitions are available at https://github.com/holidays/holidays
8
- module EL # :nodoc:
9
- def self.defined_regions
10
- [:el]
11
- end
12
-
13
- def self.holidays_by_month
14
- {
15
- 0 => [{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Μεγάλη Παρασκευή", :regions => [:el]},
16
- {:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Μεγάλο Σάββατο", :regions => [:el]},
17
- {:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Κυριακή του Πάσχα", :regions => [:el]},
18
- {:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Δευτέρα του Πάσχα", :regions => [:el]},
19
- {:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -48, :name => "Καθαρά Δευτέρα", :regions => [:el]},
20
- {:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "Αγίου Πνεύματος", :regions => [:el]}],
21
- 1 => [{:mday => 1, :name => "Πρωτοχρονιά", :regions => [:el]},
22
- {:mday => 6, :name => "Θεοφάνεια", :regions => [:el]}],
23
- 3 => [{:mday => 25, :name => "Επέτειος της Επανάστασης του 1821", :regions => [:el]}],
24
- 5 => [{:mday => 1, :name => "Πρωτομαγιά", :regions => [:el]}],
25
- 8 => [{:mday => 15, :name => "Κοίμηση της Θεοτόκου", :regions => [:el]}],
26
- 10 => [{:mday => 28, :name => "Επέτειος του Όχι", :regions => [:el]}],
27
- 12 => [{:mday => 25, :name => "Χριστούγεννα", :regions => [:el]},
28
- {:mday => 26, :name => "Δεύτερη ημέρα των Χριστουγέννων", :regions => [:el]}]
29
- }
30
- end
31
-
32
- def self.custom_methods
33
- {
34
-
35
- }
36
- end
37
- end
38
- end