holiday_co 2.0.0 → 2.0.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4bd651d32af793cec2875b1c06ede37ecd73ab634c0b51253bfc1bbfbad6e36e
|
|
4
|
+
data.tar.gz: df9a9250bc947dd0f4b101e3c37e14575fc132909dcbfecbe51ecc8138fdaf37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c97902b1daeeff404c276787b69c400259558369bf8a38bece52754cb8159dcc49dc673e6364f58904da9d4e0bdad8b4ad30ad205eef97d24f1d2f1403d627df
|
|
7
|
+
data.tar.gz: 632c676333ce2d636de2b9c2cef75d25b56cd0f9915cbad48abf594ac38fa5b6b174cc8d70d94869d8ba3ff41d26317d4a5dcb873a912fa84bd629312806f233
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Dates are in YYYY-MM-DD format
|
|
4
3
|
module HolidayCo
|
|
5
4
|
module CalculateHolidays
|
|
5
|
+
# Holidays that always fall on the same calendar date, whatever day of
|
|
6
|
+
# the week it is.
|
|
7
|
+
#
|
|
8
|
+
# Fixed.for(year) returns an array of { name:, date: } hashes, with dates
|
|
9
|
+
# as "YYYY-MM-DD" strings.
|
|
6
10
|
class Fixed
|
|
7
11
|
FIXED_HOLIDAYS = {
|
|
8
12
|
"Año Nuevo" => "%4s-01-01",
|
|
@@ -12,14 +12,22 @@ module NextMondayRefinement
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# Dates are in YYYY-MM-DD format
|
|
16
15
|
module HolidayCo
|
|
17
16
|
module CalculateHolidays
|
|
17
|
+
# Holidays covered by Ley 51 de 1983 (the "Ley Emiliani"). They have a
|
|
18
|
+
# nominal date, but if that date isn't a Monday, the holiday is observed
|
|
19
|
+
# on the following Monday.
|
|
20
|
+
#
|
|
21
|
+
# Holidays added after 1983 are listed in EFFECTIVE_SINCE and are left
|
|
22
|
+
# out for years before they took effect.
|
|
23
|
+
#
|
|
24
|
+
# Movable.for(year) returns an array of { name:, date: } hashes, with
|
|
25
|
+
# dates as "YYYY-MM-DD" strings.
|
|
18
26
|
class Movable
|
|
19
27
|
using NextMondayRefinement
|
|
20
28
|
|
|
21
29
|
# Holidays that are moved to the following Monday
|
|
22
|
-
# if they don
|
|
30
|
+
# if they don't fall on a Monday.
|
|
23
31
|
MOVABLE_HOLIDAYS = {
|
|
24
32
|
"Epifanía" => "%4s-01-06",
|
|
25
33
|
"Día de San José" => "%4s-03-19",
|
|
@@ -3,9 +3,19 @@
|
|
|
3
3
|
require "date"
|
|
4
4
|
require_relative "../utils"
|
|
5
5
|
|
|
6
|
-
# Dates are in YYYY-MM-DD format
|
|
7
6
|
module HolidayCo
|
|
8
7
|
module CalculateHolidays
|
|
8
|
+
# Holidays set relative to Easter Sunday (Domingo de Pascua), which
|
|
9
|
+
# changes every year. See HolidayCo.pascua_day_per_year for how it's
|
|
10
|
+
# calculated.
|
|
11
|
+
#
|
|
12
|
+
# Each holiday is a fixed number of days before or after Easter. The
|
|
13
|
+
# offsets after Easter already include the Ley Emiliani shift to Monday:
|
|
14
|
+
# Ascensión is Easter + 39 days, which is a Thursday, and is observed on
|
|
15
|
+
# the following Monday, Easter + 43.
|
|
16
|
+
#
|
|
17
|
+
# Pascua.for(year) returns an array of { name:, date: } hashes, with
|
|
18
|
+
# dates as "YYYY-MM-DD" strings.
|
|
9
19
|
class Pascua
|
|
10
20
|
PASCUA_HOLIDAYS = {
|
|
11
21
|
"Jueves Santo" => {
|
|
@@ -16,7 +26,7 @@ module HolidayCo
|
|
|
16
26
|
operation: :-,
|
|
17
27
|
days: 2
|
|
18
28
|
},
|
|
19
|
-
"
|
|
29
|
+
"Ascensión de Jesús" => {
|
|
20
30
|
operation: :+,
|
|
21
31
|
days: 43
|
|
22
32
|
},
|
data/lib/holiday_co/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: holiday_co
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriel Coronado
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A simple gem to handle holidays in Colombia
|
|
14
14
|
email:
|