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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/date/holiday.rb +13 -3
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d038eac10fcdf236ef718788ab47203a2c1ef255301eccbd1bb181194ae2006e
4
- data.tar.gz: e76f6b855978ec4a6bdafface5089070541d54dd0c8c8a2c442551e64df5a646
3
+ metadata.gz: df03a487c7e80486c40d32484d0f7640645422361f82a8150de4b95f19b80ab2
4
+ data.tar.gz: 9ca73e5bf58e8590d49b54ffd1352d4c885a7b8d3772ddfb54a3d513f70adc7d
5
5
  SHA512:
6
- metadata.gz: 902d309cca7e3d9f17c3fec5fe482626568bab346e45226a42b335f3dda37ff4627a196cbc364d6ce216a840f14c87fd4a371cbdf52303fa3f708af67213758c
7
- data.tar.gz: 1977cb0225b47aa373cd191031f6a12b8a39b4fc5c477f299148ab8ccb277fdf34fccce31fd86ead5c0627bd6eabd0f4c2936bb283874c9fa807d9377b04561b
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.21 2018-12-08 23:05:08+09 tadf Exp $
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 = if year != 2020 then 11 else 10 end
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.5
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: 2018-12-08 00:00:00.000000000 Z
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
- rubyforge_project: tadf
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