date-holiday 0.0.5 → 0.0.6
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/lib/date/holiday.rb +13 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df03a487c7e80486c40d32484d0f7640645422361f82a8150de4b95f19b80ab2
|
4
|
+
data.tar.gz: 9ca73e5bf58e8590d49b54ffd1352d4c885a7b8d3772ddfb54a3d513f70adc7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11cfa780eaaedfbf770553bbac88f0a72bbc91ef64ba847bd0af12fc635cfaff1c72d956594bb3a57a2f49f36870997c95e0b53303de981056bdfa7a2654f902
|
7
|
+
data.tar.gz: a1904a7720e2629aeb2084a6811973c621e13ad1a95700633a59b5cadab883a7ceac5faef179f36c675c91d7d4849ff7a75931ac226a0d09da879ee9eeff266d
|
data/lib/date/holiday.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# date/holiday.rb: Written by Tadayoshi Funaba 1998-2006,2014,2018
|
2
|
-
# $Id: holiday.rb,v 2.
|
1
|
+
# date/holiday.rb: Written by Tadayoshi Funaba 1998-2006,2014,2018,2021
|
2
|
+
# $Id: holiday.rb,v 2.22 2021-02-24 08:57:15+09 tadf Exp $
|
3
3
|
|
4
4
|
require 'date'
|
5
5
|
|
@@ -8,7 +8,11 @@ class Date
|
|
8
8
|
def fixed?
|
9
9
|
return false unless jd >= 2432753 # 1948-07-20/PooD
|
10
10
|
*x = mon, mday
|
11
|
-
xi =
|
11
|
+
xi = case year
|
12
|
+
when 2020; 10
|
13
|
+
when 2021; 8
|
14
|
+
else; 11
|
15
|
+
end
|
12
16
|
(x == [ 1, 1]) || # --01-01
|
13
17
|
(x == [ 1, 15] && # --01-15 (1948-07-20/1999-12-31)
|
14
18
|
jd <= 2451544) ||
|
@@ -86,6 +90,12 @@ class Date
|
|
86
90
|
jd == 2459055 || # --07-24
|
87
91
|
jd == 2459114 # --09-21
|
88
92
|
end
|
93
|
+
if year == 2021
|
94
|
+
return jd == 2459226 || # --01-11
|
95
|
+
jd == 2459418 || # --07-22
|
96
|
+
jd == 2459419 || # --07-23
|
97
|
+
jd == 2459478 # --09-20
|
98
|
+
end
|
89
99
|
(mon == 1 && nth_kday?(2, 1) && # 2nd Mon, Jan (2000-01-01/PooD)
|
90
100
|
jd >= 2451545) ||
|
91
101
|
(mon == 7 && nth_kday?(3, 1) && # 3nd Mon, Jul (2003-01-01/PooD)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: date-holiday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tadayoshi Funaba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: tadf@funaba.org
|
@@ -47,8 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
|
-
|
51
|
-
rubygems_version: 2.7.6
|
50
|
+
rubygems_version: 3.1.2
|
52
51
|
signing_key:
|
53
52
|
specification_version: 4
|
54
53
|
summary: determination of holiday
|