holidays 11.4.0 → 11.5.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/generated_definitions/MANIFEST +1 -0
- data/lib/generated_definitions/REGIONS.rb +3 -3
- data/lib/generated_definitions/ar.rb +1 -18
- data/lib/generated_definitions/at.rb +1 -3
- data/lib/generated_definitions/au.rb +1 -86
- data/lib/generated_definitions/be_fr.rb +1 -3
- data/lib/generated_definitions/be_nl.rb +1 -3
- data/lib/generated_definitions/bg.rb +1 -3
- data/lib/generated_definitions/br.rb +1 -3
- data/lib/generated_definitions/by.rb +1 -3
- data/lib/generated_definitions/ca.rb +4 -14
- data/lib/generated_definitions/ch.rb +1 -48
- data/lib/generated_definitions/cl.rb +1 -33
- data/lib/generated_definitions/cn.rb +39 -0
- data/lib/generated_definitions/co.rb +1 -12
- data/lib/generated_definitions/cr.rb +1 -3
- data/lib/generated_definitions/cy.rb +1 -3
- data/lib/generated_definitions/cz.rb +1 -3
- data/lib/generated_definitions/de.rb +2 -14
- data/lib/generated_definitions/dk.rb +1 -3
- data/lib/generated_definitions/ecbtarget.rb +1 -3
- data/lib/generated_definitions/ee.rb +1 -3
- data/lib/generated_definitions/es.rb +1 -3
- data/lib/generated_definitions/europe.rb +4 -94
- data/lib/generated_definitions/federalreserve.rb +1 -3
- data/lib/generated_definitions/federalreservebanks.rb +1 -3
- data/lib/generated_definitions/fedex.rb +1 -7
- data/lib/generated_definitions/fi.rb +1 -25
- data/lib/generated_definitions/fr.rb +1 -3
- data/lib/generated_definitions/gb.rb +1 -3
- data/lib/generated_definitions/ge.rb +1 -3
- data/lib/generated_definitions/gr.rb +1 -3
- data/lib/generated_definitions/hk.rb +1 -3
- data/lib/generated_definitions/hr.rb +1 -3
- data/lib/generated_definitions/hu.rb +1 -3
- data/lib/generated_definitions/ie.rb +1 -12
- data/lib/generated_definitions/il.rb +1 -3
- data/lib/generated_definitions/in.rb +1 -3
- data/lib/generated_definitions/is.rb +1 -13
- data/lib/generated_definitions/it.rb +1 -3
- data/lib/generated_definitions/jp.rb +1 -95
- data/lib/generated_definitions/ke.rb +1 -3
- data/lib/generated_definitions/kr.rb +4 -6
- data/lib/generated_definitions/kz.rb +1 -3
- data/lib/generated_definitions/li.rb +1 -3
- data/lib/generated_definitions/lt.rb +1 -3
- data/lib/generated_definitions/lu.rb +1 -3
- data/lib/generated_definitions/lv.rb +1 -17
- data/lib/generated_definitions/ma.rb +1 -3
- data/lib/generated_definitions/mc.rb +1 -3
- data/lib/generated_definitions/mt_en.rb +1 -3
- data/lib/generated_definitions/mt_mt.rb +1 -3
- data/lib/generated_definitions/mx.rb +4 -4
- data/lib/generated_definitions/my.rb +1 -3
- data/lib/generated_definitions/nerc.rb +1 -3
- data/lib/generated_definitions/ng.rb +1 -3
- data/lib/generated_definitions/nl.rb +1 -3
- data/lib/generated_definitions/no.rb +1 -3
- data/lib/generated_definitions/northamerica.rb +4 -97
- data/lib/generated_definitions/nyse.rb +1 -3
- data/lib/generated_definitions/nz.rb +4 -70
- data/lib/generated_definitions/pe.rb +1 -3
- data/lib/generated_definitions/ph.rb +1 -9
- data/lib/generated_definitions/pl.rb +1 -3
- data/lib/generated_definitions/pt.rb +1 -3
- data/lib/generated_definitions/ro.rb +3 -5
- data/lib/generated_definitions/rs_cyrl.rb +1 -3
- data/lib/generated_definitions/rs_la.rb +1 -3
- data/lib/generated_definitions/ru.rb +1 -3
- data/lib/generated_definitions/scandinavia.rb +1 -47
- data/lib/generated_definitions/se.rb +1 -15
- data/lib/generated_definitions/sg.rb +1 -3
- data/lib/generated_definitions/si.rb +1 -3
- data/lib/generated_definitions/sk.rb +1 -3
- data/lib/generated_definitions/southamerica.rb +1 -57
- data/lib/generated_definitions/th.rb +1 -3
- data/lib/generated_definitions/tn.rb +1 -3
- data/lib/generated_definitions/tr.rb +1 -29
- data/lib/generated_definitions/tsx.rb +1 -13
- data/lib/generated_definitions/ua.rb +1 -3
- data/lib/generated_definitions/unitednations.rb +1 -3
- data/lib/generated_definitions/ups.rb +1 -7
- data/lib/generated_definitions/us.rb +4 -87
- data/lib/generated_definitions/ve.rb +1 -3
- data/lib/generated_definitions/vn.rb +1 -3
- data/lib/generated_definitions/za.rb +1 -3
- data/lib/holidays/{load_all_definitions.rb → bootstrap.rb} +15 -8
- data/lib/holidays/date_calculator/lunar_date.rb +1 -0
- data/lib/holidays/definition/context/generator.rb +4 -0
- data/lib/holidays/definition/custom_methods/ar.rb +28 -0
- data/lib/holidays/definition/custom_methods/au.rb +96 -0
- data/lib/holidays/definition/custom_methods/ca.rb +23 -0
- data/lib/holidays/definition/custom_methods/ch.rb +58 -0
- data/lib/holidays/definition/custom_methods/cl.rb +43 -0
- data/lib/holidays/definition/custom_methods/cn.rb +31 -0
- data/lib/holidays/definition/custom_methods/co.rb +22 -0
- data/lib/holidays/definition/custom_methods/de.rb +23 -0
- data/lib/holidays/definition/custom_methods/fedex.rb +17 -0
- data/lib/holidays/definition/custom_methods/fi.rb +35 -0
- data/lib/holidays/definition/custom_methods/ie.rb +22 -0
- data/lib/holidays/definition/custom_methods/is.rb +23 -0
- data/lib/holidays/definition/custom_methods/jp.rb +107 -0
- data/lib/holidays/definition/custom_methods/kr.rb +17 -0
- data/lib/holidays/definition/custom_methods/lv.rb +27 -0
- data/lib/holidays/definition/custom_methods/nz.rb +77 -0
- data/lib/holidays/definition/custom_methods/ph.rb +19 -0
- data/lib/holidays/definition/custom_methods/registry.rb +103 -0
- data/lib/holidays/definition/custom_methods/se.rb +25 -0
- data/lib/holidays/definition/custom_methods/tr.rb +59 -0
- data/lib/holidays/definition/custom_methods/us.rb +92 -0
- data/lib/holidays/definition/generator/module.rb +7 -4
- data/lib/holidays/version.rb +1 -1
- data/lib/holidays.rb +4 -2
- metadata +24 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 450c972e94224caf8a44edc3865c9d7246aa7a0f0ac16c5d41156ff2ca460741
|
|
4
|
+
data.tar.gz: 2a17f504696cdf7f345fb75b2b715f24f34218c132bb50d61265c8556475aee5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1379f15a3ad2d6f06278d7e3806007145a58e78dadbaba0395aabc44bde996f36fc76b088be197a2101d7088b6b1107b924ed8fc850bbe91327e9c7a7bdeb947
|
|
7
|
+
data.tar.gz: 2cce27a209357ec151b8048cdf2c5a6b532b4613693c52673d489d9c9604fe03394d8c2abb911939ecb44dafac2dfa63eb7cd2b29cd96bc113864868e9285ddf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Ruby Holidays Gem CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 11.5.0
|
|
4
|
+
|
|
5
|
+
* Update to [v9.0.0 definitions](https://github.com/holidays/definitions/releases/tag/v9.0.0): new `cn` region; `jp`, `kr`, `nz_sl`, `nz_hb`, `ro` date fixes; `tr` feasts through 2030; `de_be` 2025; informal Day of the Dead for `us`/`ca`. The v9.0.0 major is a definitions format change only and does not affect gem results or API.
|
|
6
|
+
* Host region custom calculation methods natively instead of eval-ing Ruby from the definitions YAML; results unchanged. [#496](https://github.com/holidays/holidays/issues/496), [#498](https://github.com/holidays/holidays/pull/498), [#499](https://github.com/holidays/holidays/pull/499), [#500](https://github.com/holidays/holidays/pull/500)
|
|
7
|
+
* Add `:cn` to the lunar calendar region map. [#494](https://github.com/holidays/holidays/pull/494)
|
|
8
|
+
* Fix `observed` methods with arguments other than `date` raising `NoMethodError` under `load_custom`. [#501](https://github.com/holidays/holidays/pull/501)
|
|
9
|
+
* Rename internal `Holidays::LoadAllDefinitions` to a private `Holidays::Bootstrap`. [#497](https://github.com/holidays/holidays/issues/497)
|
|
10
|
+
|
|
3
11
|
## 11.4.0
|
|
4
12
|
|
|
5
13
|
* Update to [v8.2.0 definitions](https://github.com/holidays/definitions/releases/tag/v8.2.0). Please see the changelog for the definition details.
|
|
@@ -13,6 +13,7 @@ The following definition files are included in this installation:
|
|
|
13
13
|
* generated_definitions/ca
|
|
14
14
|
* generated_definitions/ch
|
|
15
15
|
* generated_definitions/cl
|
|
16
|
+
* generated_definitions/cn
|
|
16
17
|
* generated_definitions/co
|
|
17
18
|
* generated_definitions/cr
|
|
18
19
|
* generated_definitions/cy
|
|
@@ -1,8 +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, :by, :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]
|
|
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, :by, :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, :cn, :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, by: :by, 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}
|
|
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, by: :by, 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, cn: :cn, 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
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", :by => "Belarus", :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"}
|
|
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", :by => "Belarus", :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", :cn => "China", :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"}
|
|
8
8
|
end
|
|
@@ -37,24 +37,7 @@ module Holidays
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def self.custom_methods
|
|
40
|
-
{
|
|
41
|
-
"to_nearest_monday(date)" => Proc.new { |date|
|
|
42
|
-
case date.wday
|
|
43
|
-
when 5
|
|
44
|
-
date += 3
|
|
45
|
-
when 4
|
|
46
|
-
date += 4
|
|
47
|
-
when 3
|
|
48
|
-
date -= 2
|
|
49
|
-
when 2
|
|
50
|
-
date -= 1
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
date
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
40
|
+
{}
|
|
58
41
|
end
|
|
59
42
|
end
|
|
60
43
|
end
|
|
@@ -64,92 +64,7 @@ module Holidays
|
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def self.custom_methods
|
|
67
|
-
{
|
|
68
|
-
"afl_grand_final(year)" => Proc.new { |year|
|
|
69
|
-
case year
|
|
70
|
-
when 2015
|
|
71
|
-
Date.civil(2015, 10, 2)
|
|
72
|
-
when 2016
|
|
73
|
-
Date.civil(2016, 9, 30)
|
|
74
|
-
when 2017
|
|
75
|
-
Date.civil(2017, 9, 29)
|
|
76
|
-
when 2020
|
|
77
|
-
Date.civil(2020, 10, 23)
|
|
78
|
-
when 2022
|
|
79
|
-
Date.civil(2022, 9, 23)
|
|
80
|
-
else
|
|
81
|
-
# Friday before AFL Grand Final typically falls on the last Friday in September
|
|
82
|
-
# Override when falls on a different date
|
|
83
|
-
last_day = Date.civil(year, 9, -1)
|
|
84
|
-
last_friday = last_day - ((last_day.wday - 5) % 7)
|
|
85
|
-
last_friday
|
|
86
|
-
end
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
"qld_queens_bday_october(year)" => Proc.new { |year|
|
|
90
|
-
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1)
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
"qld_kings_bday_october(year)" => Proc.new { |year|
|
|
94
|
-
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1)
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
"qld_queens_birthday_june(year)" => Proc.new { |year|
|
|
98
|
-
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, 1)
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
"qld_labour_day_may(year)" => Proc.new { |year|
|
|
102
|
-
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, 1, 1)
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
"qld_labour_day_october(year)" => Proc.new { |year|
|
|
106
|
-
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1)
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
"hobart_show_day(year)" => Proc.new { |year|
|
|
110
|
-
fourth_sat_in_oct = Date.civil(year, 10, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 4, :saturday))
|
|
111
|
-
fourth_sat_in_oct - 2 # the thursday before
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
"march_pub_hol_sa(year)" => Proc.new { |year|
|
|
115
|
-
Date.civil(year, 3, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 3, :second, :monday))
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
"may_pub_hol_sa(year)" => Proc.new { |year|
|
|
119
|
-
Date.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday))
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
"qld_brisbane_ekka_holiday(year)" => Proc.new { |year|
|
|
123
|
-
first_friday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :first, :friday)
|
|
124
|
-
|
|
125
|
-
if first_friday < 5
|
|
126
|
-
second_friday = Date.civil(year, 8, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :second, :friday))
|
|
127
|
-
second_friday + 5 # The next Wednesday
|
|
128
|
-
else
|
|
129
|
-
Date.civil(year, 8, first_friday) + 5
|
|
130
|
-
end
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
"to_nearest_monday_after(date)" => Proc.new { |date|
|
|
134
|
-
case date.wday
|
|
135
|
-
when 6
|
|
136
|
-
date += 2
|
|
137
|
-
when 5
|
|
138
|
-
date += 3
|
|
139
|
-
when 4
|
|
140
|
-
date += 4
|
|
141
|
-
when 3
|
|
142
|
-
date += 5
|
|
143
|
-
when 2
|
|
144
|
-
date += 6
|
|
145
|
-
when 0
|
|
146
|
-
date += 1
|
|
147
|
-
end
|
|
148
|
-
date
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
67
|
+
{}
|
|
153
68
|
end
|
|
154
69
|
end
|
|
155
70
|
end
|
|
@@ -57,7 +57,9 @@ module Holidays
|
|
|
57
57
|
{:mday => 30, :year_ranges => { :from => 2021 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "National Day for Truth and Reconciliation", :regions => [:ca_ab, :ca_mb, :ca_nu]}],
|
|
58
58
|
10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_qc, :ca_sk, :ca_yt]},
|
|
59
59
|
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
|
60
|
-
11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt]}
|
|
60
|
+
11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt]},
|
|
61
|
+
{:mday => 1, :type => :informal, :name => "Day of the Dead", :regions => [:us, :ca]},
|
|
62
|
+
{:mday => 2, :type => :informal, :name => "Day of the Dead", :regions => [:us, :ca]}],
|
|
61
63
|
12 => [{:mday => 25, :year_ranges => { :until => 2020 },:observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_on]},
|
|
62
64
|
{:mday => 25, :year_ranges => { :from => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_on]},
|
|
63
65
|
{:mday => 25, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_qc, :ca_sk, :ca_yt]},
|
|
@@ -70,19 +72,7 @@ module Holidays
|
|
|
70
72
|
end
|
|
71
73
|
|
|
72
74
|
def self.custom_methods
|
|
73
|
-
{
|
|
74
|
-
"ca_victoria_day(year)" => Proc.new { |year|
|
|
75
|
-
date = Date.civil(year,5,24)
|
|
76
|
-
if date.wday > 1
|
|
77
|
-
date -= (date.wday - 1)
|
|
78
|
-
elsif date.wday == 0
|
|
79
|
-
date -= 6
|
|
80
|
-
end
|
|
81
|
-
date
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
75
|
+
{}
|
|
86
76
|
end
|
|
87
77
|
end
|
|
88
78
|
end
|
|
@@ -42,54 +42,7 @@ module Holidays
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def self.custom_methods
|
|
45
|
-
{
|
|
46
|
-
"ch_vd_lundi_du_jeune_federal(year)" => Proc.new { |year|
|
|
47
|
-
date = Date.civil(year,9,1)
|
|
48
|
-
# Find the first Sunday of September
|
|
49
|
-
until date.wday.eql? 0 do
|
|
50
|
-
date += 1
|
|
51
|
-
end
|
|
52
|
-
# There are 15 days between the first Sunday
|
|
53
|
-
# and the Monday after the third Sunday
|
|
54
|
-
date + 15
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
"ch_ge_jeune_genevois(year)" => Proc.new { |year|
|
|
58
|
-
date = Date.civil(year,9,1)
|
|
59
|
-
# Find the first Sunday of September
|
|
60
|
-
until date.wday.eql? 0 do
|
|
61
|
-
date += 1
|
|
62
|
-
end
|
|
63
|
-
# Thursday is four days after Sunday
|
|
64
|
-
date + 4
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
"ch_gl_naefelser_fahrt(year)" => Proc.new { |year|
|
|
68
|
-
date = Date.civil(year,4,1)
|
|
69
|
-
# Find the first Thursday of April
|
|
70
|
-
until date.wday.eql? 4 do
|
|
71
|
-
date += 1
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
if date.eql?(Holidays::Factory::DateCalculator::Easter::Gregorian.easter_calculator.calculate_easter_for(year)-3)
|
|
75
|
-
date += 7
|
|
76
|
-
end
|
|
77
|
-
date
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
"ch_be_zibelemaerit(year)" => Proc.new { |year|
|
|
81
|
-
date = Date.civil(year,11,1)
|
|
82
|
-
# Find the first Monday of November
|
|
83
|
-
until date.wday.eql? 1 do
|
|
84
|
-
date += 1
|
|
85
|
-
end
|
|
86
|
-
# There are 21 days between the first monday
|
|
87
|
-
# and the 4rth Monday after
|
|
88
|
-
date + 21
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
45
|
+
{}
|
|
93
46
|
end
|
|
94
47
|
end
|
|
95
48
|
end
|
|
@@ -33,39 +33,7 @@ module Holidays
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def self.custom_methods
|
|
36
|
-
{
|
|
37
|
-
"st_peter_st_paul_cl(year)" => Proc.new { |year|
|
|
38
|
-
date = Date.civil(year, 6, 29)
|
|
39
|
-
if [2,3,4].include?(date.wday)
|
|
40
|
-
date -= (date.wday - 1)
|
|
41
|
-
elsif date.wday == 5
|
|
42
|
-
date += 3
|
|
43
|
-
end
|
|
44
|
-
date
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
"columbus_day_cl(year)" => Proc.new { |year|
|
|
48
|
-
date = Date.civil(year, 10, 12)
|
|
49
|
-
if [2,3,4].include?(date.wday)
|
|
50
|
-
date -= (date.wday - 1)
|
|
51
|
-
elsif date.wday == 5
|
|
52
|
-
date += 3
|
|
53
|
-
end
|
|
54
|
-
date
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
"other_churches_day_cl(year)" => Proc.new { |year|
|
|
58
|
-
date = Date.civil(year, 10, 31)
|
|
59
|
-
if date.wday == 2
|
|
60
|
-
date -= 4
|
|
61
|
-
elsif date.wday == 3
|
|
62
|
-
date += 2
|
|
63
|
-
end
|
|
64
|
-
date
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
36
|
+
{}
|
|
69
37
|
end
|
|
70
38
|
end
|
|
71
39
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
module Holidays
|
|
3
|
+
# This file is generated by the Ruby Holidays gem.
|
|
4
|
+
#
|
|
5
|
+
# Definitions loaded: definitions/cn.yaml
|
|
6
|
+
#
|
|
7
|
+
# All the definitions are available at https://github.com/holidays/holidays
|
|
8
|
+
module CN # :nodoc:
|
|
9
|
+
def self.defined_regions
|
|
10
|
+
[:cn]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.holidays_by_month
|
|
14
|
+
{
|
|
15
|
+
1 => [{:mday => 1, :name => "元旦", :regions => [:cn]},
|
|
16
|
+
{:mday => 1, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :function_modifier => -1, :year_ranges => { :between => 2008..2013 },:name => "除夕", :regions => [:cn]},
|
|
17
|
+
{:mday => 1, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :function_modifier => -1, :year_ranges => { :from => 2025 },:name => "除夕", :regions => [:cn]},
|
|
18
|
+
{:mday => 1, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "春节", :regions => [:cn]},
|
|
19
|
+
{:mday => 2, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "春节", :regions => [:cn]},
|
|
20
|
+
{:mday => 3, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :year_ranges => { :until => 2007 },:name => "春节", :regions => [:cn]},
|
|
21
|
+
{:mday => 3, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :year_ranges => { :from => 2014 },:name => "春节", :regions => [:cn]}],
|
|
22
|
+
4 => [{:function => "cn_qingming(year)", :function_arguments => [:year], :year_ranges => { :from => 2008 },:name => "清明节", :regions => [:cn]}],
|
|
23
|
+
5 => [{:mday => 1, :name => "劳动节", :regions => [:cn]},
|
|
24
|
+
{:mday => 2, :year_ranges => { :until => 2007 },:name => "劳动节", :regions => [:cn]},
|
|
25
|
+
{:mday => 2, :year_ranges => { :from => 2025 },:name => "劳动节", :regions => [:cn]},
|
|
26
|
+
{:mday => 3, :year_ranges => { :until => 2007 },:name => "劳动节", :regions => [:cn]},
|
|
27
|
+
{:mday => 5, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :year_ranges => { :from => 2008 },:name => "端午节", :regions => [:cn]}],
|
|
28
|
+
8 => [{:mday => 15, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :year_ranges => { :from => 2008 },:name => "中秋节", :regions => [:cn]}],
|
|
29
|
+
10 => [{:mday => 1, :name => "国庆节", :regions => [:cn]},
|
|
30
|
+
{:mday => 2, :name => "国庆节", :regions => [:cn]},
|
|
31
|
+
{:mday => 3, :name => "国庆节", :regions => [:cn]}]
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.custom_methods
|
|
36
|
+
{}
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -35,18 +35,7 @@ module Holidays
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def self.custom_methods
|
|
38
|
-
{
|
|
39
|
-
"to_following_monday_if_not_monday(date)" => Proc.new { |date|
|
|
40
|
-
if date.wday > 1
|
|
41
|
-
date += ( 8 - date.wday )
|
|
42
|
-
elsif date.wday == 0
|
|
43
|
-
date += 1
|
|
44
|
-
end
|
|
45
|
-
date
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
38
|
+
{}
|
|
50
39
|
end
|
|
51
40
|
end
|
|
52
41
|
end
|
|
@@ -28,7 +28,7 @@ module Holidays
|
|
|
28
28
|
3 => [{:mday => 8, :year_ranges => { :from => 2019 },:name => "Internationaler Frauentag", :regions => [:de_be]},
|
|
29
29
|
{:mday => 8, :year_ranges => { :from => 2023 },:name => "Internationaler Frauentag", :regions => [:de_mv]}],
|
|
30
30
|
5 => [{:mday => 1, :year_ranges => { :from => 1933 },:name => "Tag der Arbeit", :regions => [:de]},
|
|
31
|
-
{:mday => 8, :year_ranges => { :limited => [2020] },:name => "Tag der Befreiung", :regions => [:de_be]}],
|
|
31
|
+
{:mday => 8, :year_ranges => { :limited => [2020, 2025] },:name => "Tag der Befreiung", :regions => [:de_be]}],
|
|
32
32
|
6 => [{:mday => 17, :year_ranges => { :between => 1954..1990 },:name => "Tag der Deutschen Einheit", :regions => [:de]},
|
|
33
33
|
{:mday => 17, :year_ranges => { :limited => [2028] },:name => "Jahrestag des Volksaufstands in der DDR", :regions => [:de_be]}],
|
|
34
34
|
8 => [{:mday => 15, :name => "Mariä Himmelfahrt", :regions => [:de_by_cath, :de_by_augsburg, :de_sl]},
|
|
@@ -51,19 +51,7 @@ module Holidays
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def self.custom_methods
|
|
54
|
-
{
|
|
55
|
-
"de_buss_und_bettag(year)" => Proc.new { |year|
|
|
56
|
-
date = Date.civil(year,11,23)
|
|
57
|
-
if date.wday > 3
|
|
58
|
-
date -= (date.wday - 3)
|
|
59
|
-
else
|
|
60
|
-
date -= (date.wday + 4)
|
|
61
|
-
end
|
|
62
|
-
date
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
54
|
+
{}
|
|
67
55
|
end
|
|
68
56
|
end
|
|
69
57
|
end
|