date-holiday 0.0.3 → 0.0.4

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 +9 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c1a61bb51dbd12f7d85dc6b7a9e7f019b297f55
4
- data.tar.gz: de6de58fa3c04daae3187b338bd1959100981e47
3
+ metadata.gz: b8a1d6b9395a7db9f994b8965e0cf72c36d45f43
4
+ data.tar.gz: 5adcd575df78abe009856e75e7879a03895803ff
5
5
  SHA512:
6
- metadata.gz: 9aaabef89893840820efddcd909cebb0cab47acaa04745e5a3b2602a07c2d09310ec853c659ca6e6ab6ea0ff516fc1cf44cf981835283f46fd4003bd5edc5918
7
- data.tar.gz: d1a1acd9d359c6e6c6173a218e7fac743965824db37ee98073ccbee0b820d4585edb7b1d4d499e1f6bff67146631c843a30ea32894ab4ac890a696152e16abc7
6
+ metadata.gz: 2f82bd040e4276c8d185ec59388e11e32e89d70d8dbff8c56af51787c806cac53848466d52788a731de6f519bbc6384eca76eacbcb75e96bc3b567ea3d849961
7
+ data.tar.gz: 705af3448c2dea51f382dabd5eae5d4ae7e564ea84458173b7028fb41ad062fc0b054f56e99786b15a13f2d773a601ae780c2366a8dc64b6f34bc285fae1fd71
data/lib/date/holiday.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # date/holiday.rb: Written by Tadayoshi Funaba 1998-2006,2014,2018
2
- # $Id: holiday.rb,v 2.19 2018/05/04 08:53:44 tadf Exp $
2
+ # $Id: holiday.rb,v 2.20 2018/07/05 01:11:49 tadf Exp $
3
3
 
4
4
  require 'date'
5
5
 
@@ -8,6 +8,7 @@ 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
12
  (x == [ 1, 1]) || # --01-01
12
13
  (x == [ 1, 15] && # --01-15 (1948-07-20/1999-12-31)
13
14
  jd <= 2451544) ||
@@ -23,7 +24,7 @@ class Date
23
24
  (x == [ 7, 20] && # --07-20 (1996-01-01/2002-12-31)
24
25
  jd >= 2450084 &&
25
26
  jd <= 2452640) ||
26
- (x == [ 8, 11] && # --08-11 (2016-01-01/PooD)
27
+ (x == [ 8, xi] && # --08-11 (2016-01-01/PooD) ex 2020-08-10
27
28
  jd >= 2457389) ||
28
29
  (x == [ 9, 15] && # --09-15 (1966-06-25/2002-12-31)
29
30
  jd >= 2439302 &&
@@ -79,6 +80,12 @@ class Date
79
80
  private :nth_kday?
80
81
 
81
82
  def float?
83
+ if year == 2020
84
+ return jd == 2458862 || # --01-13
85
+ jd == 2459054 || # --07-23
86
+ jd == 2459055 || # --07-24
87
+ jd == 2459114 # --09-21
88
+ end
82
89
  (mon == 1 && nth_kday?(2, 1) && # 2nd Mon, Jan (2000-01-01/PooD)
83
90
  jd >= 2451545) ||
84
91
  (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.3
4
+ version: 0.0.4
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-05-04 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: tadf@funaba.org