fat_date 0.1.4 → 0.2.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.
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.38
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Top Level Namespace
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <h2>Defined Under Namespace</h2>
82
+ <p class="children">
83
+
84
+
85
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="FatDate.html" title="FatDate (module)">FatDate</a></span>
86
+
87
+
88
+
89
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Date.html" title="Date (class)">Date</a></span>, <span class='object_link'><a href="DateTime.html" title="DateTime (class)">DateTime</a></span>, <span class='object_link'><a href="Numeric.html" title="Numeric (class)">Numeric</a></span>
90
+
91
+
92
+ </p>
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ </div>
103
+
104
+ <div id="footer">
105
+ Generated on Wed Dec 24 05:26:32 2025 by
106
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
+ 0.9.38 (ruby-3.4.1).
108
+ </div>
109
+
110
+ </div>
111
+ </body>
112
+ </html>
data/lib/fat_date/date.rb CHANGED
@@ -925,7 +925,7 @@ module FatDate
925
925
  end
926
926
 
927
927
  # Holidays decreed by Presidential proclamation
928
- FED_DECREED_HOLIDAYS =
928
+ FED_DECREED_HOLIDAYS =
929
929
  [
930
930
  # Obama decree extra day before Christmas See
931
931
  # http://www.whitehouse.gov/the-press-office/2012/12/21
@@ -936,6 +936,9 @@ module FatDate
936
936
  ::Date.parse('2020-12-24'),
937
937
  # Biden
938
938
  ::Date.parse('2024-12-24'),
939
+ # Trump
940
+ ::Date.parse('2025-12-24'),
941
+ ::Date.parse('2025-12-26'),
939
942
  ]
940
943
 
941
944
  # Presidential funeral since JFK
@@ -1289,7 +1292,7 @@ module FatDate
1289
1292
  # rigged to fall on Monday except Thanksgiving
1290
1293
 
1291
1294
  # No moveable feasts in certain months
1292
- return false if [6, 7, 8, 10, 12].include?(month)
1295
+ return false if [7, 8, 10, 12].include?(month)
1293
1296
 
1294
1297
  case month
1295
1298
  when 1
@@ -1318,6 +1321,21 @@ module FatDate
1318
1321
  when 5
1319
1322
  # Memorial Day (Last Monday in May)
1320
1323
  year <= 1970 ? (month == 5 && day == 30) : nth_wday_in_month?(-1, 1, 5)
1324
+ when 6
1325
+ # Juneteenth, starting 2022. On June 19, but moved to prior Friday if
1326
+ # it falls on Saturday and moved to Monday if it fall on Sunday.
1327
+ if year < 2022
1328
+ false
1329
+ else
1330
+ jun19 = ::Date.new(year, 6, 19)
1331
+ if jun19.saturday?
1332
+ day == 18
1333
+ elsif jun19.sunday?
1334
+ day == 20
1335
+ else
1336
+ day == 19
1337
+ end
1338
+ end
1321
1339
  when 9
1322
1340
  # Labor Day (First Monday in Sep)
1323
1341
  nth_wday_in_month?(1, 1, 9)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module FatDate
2
4
  module DateTime
3
5
  # Format as an ISO string of the form `YYYY-MM-DD`.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FatDate
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/fat_date.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'date'
3
4
  require 'active_support'
4
5
  require "active_support/isolated_execution_state"
5
6
  require "active_support/core_ext/date"
@@ -9,7 +10,24 @@ require "active_support/core_ext/integer/time"
9
10
 
10
11
  require 'fat_core/string'
11
12
 
12
- require_relative "fat_date/version"
13
- require_relative "fat_date/patches"
14
- require_relative "fat_date/date"
15
- require_relative "fat_date/datetime"
13
+ # Gem Overview (extracted from README.org by gem_docs)
14
+ #
15
+ # * Introduction
16
+ # ~fat_date~ collects core extensions for the Date class to make it more useful
17
+ # in financial applications, including:
18
+ #
19
+ # - determining when a =Date= is a federal or NYSE holiday with Presidential
20
+ # decrees included,
21
+ # - determining when a =Date= is part of a larger calendar-related "chunk," such
22
+ # as a year, half, quarter, bimonth, month, semimonth, or week,
23
+ # - calculating Easter for a =Date's= year, a date on which some "movable
24
+ # feasts" depend, and
25
+ # - parsing so-called "specs" that allow the beginning or ending =Date= of a
26
+ # larger period of time to be returned, a facility put to good use in the
27
+ # [[https://github.com/ddoherty03/fat_period][FatPeriod]] gem.
28
+ module FatDate
29
+ require_relative "fat_date/version"
30
+ require_relative "fat_date/patches"
31
+ require_relative "fat_date/date"
32
+ require_relative "fat_date/date_time"
33
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-12-04 00:00:00.000000000 Z
10
+ date: 2026-06-30 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -52,13 +52,36 @@ files:
52
52
  - ".rspec"
53
53
  - ".rubocop.yml"
54
54
  - ".ruby-version"
55
+ - ".yardopts"
55
56
  - CHANGELOG.org
56
57
  - LICENSE.txt
58
+ - README.md
57
59
  - README.org
58
60
  - Rakefile
61
+ - doc/Date.html
62
+ - doc/DateTime.html
63
+ - doc/FatDate.html
64
+ - doc/FatDate/Date.html
65
+ - doc/FatDate/Date/ClassMethods.html
66
+ - doc/FatDate/DateTime.html
67
+ - doc/Numeric.html
68
+ - doc/_index.html
69
+ - doc/class_list.html
70
+ - doc/css/common.css
71
+ - doc/css/full_list.css
72
+ - doc/css/style.css
73
+ - doc/file.README.html
74
+ - doc/file_list.html
75
+ - doc/frames.html
76
+ - doc/index.html
77
+ - doc/js/app.js
78
+ - doc/js/full_list.js
79
+ - doc/js/jquery.js
80
+ - doc/method_list.html
81
+ - doc/top-level-namespace.html
59
82
  - lib/fat_date.rb
60
83
  - lib/fat_date/date.rb
61
- - lib/fat_date/datetime.rb
84
+ - lib/fat_date/date_time.rb
62
85
  - lib/fat_date/patches.rb
63
86
  - lib/fat_date/version.rb
64
87
  - sig/fat_date.rbs
@@ -82,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
105
  - !ruby/object:Gem::Version
83
106
  version: '0'
84
107
  requirements: []
85
- rubygems_version: 3.6.3
108
+ rubygems_version: 3.6.2
86
109
  specification_version: 4
87
110
  summary: Useful extensions to the Date class.
88
111
  test_files: []