date_values 0.2.2 → 0.2.3

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: 10dc98d9c1080745a0aebb8880f9bbafd34d1d5c9103736683b35633f6cd8d2c
4
- data.tar.gz: aa7288bf8c473376b30f0e46fadfd1b78c79c34173deae88055d3ce5f7e47ec5
3
+ metadata.gz: 8c3fb888a1c6c05e7c93daa93a9f437d0314aba58532b18004e43e30e7cd746f
4
+ data.tar.gz: d8b9bf436a909859ed79f287b47dbc654a70487e0abda94357f74cad8368b96b
5
5
  SHA512:
6
- metadata.gz: 34876d1314f36317f6fd2392e5489327e00f56df5b62cfcce0f27432469026957dfbf328459dbb1c84a9e1511e5c989f9ca556988ecefcf5f05d60df65ad2e56
7
- data.tar.gz: '09fe11dd318422c430a941be38194bdeff80ff550a9fbce78076cad789d70076c698a2e409d03c79ea85aa61a3c4d2f2b03c00b28192facb6ec90e78b5dac222'
6
+ metadata.gz: 4f51c14f83d7ffc5e54dc68b396a294a32dcc57c986ec282983a81724f22cf5373fbe512e9699e29d1b9d4b3d7340669ddfec1a8338bc887fd7d69dc8f28c1f8
7
+ data.tar.gz: 4ec4caa7581281fe1269fae60f7538e44b9459c808307c153df4372ab79e110c5a98c55c8aa9138c1aa573ec6108c9580633fd1a2077d8735f7b47682e5bd459
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.3] - 2026-03-31
4
+
5
+ - Add `YearMonth#to_date_range` — returns an exclusive `Date` range for the month, ideal for ActiveRecord queries on timestamp columns
6
+
3
7
  ## [0.2.2] - 2026-03-21
4
8
 
5
9
  - `TimeOfDay#-` accepts `TimeOfDay` to return difference in seconds
data/README.md CHANGED
@@ -23,6 +23,7 @@ include DateValues
23
23
  ym = YearMonth.new(2026, 3)
24
24
  ym.to_s # => "2026-03"
25
25
  ym.to_date # => #<Date: 2026-03-01>
26
+ ym.to_date_range # => 2026-03-01...2026-04-01
26
27
  ym.days # => 31
27
28
 
28
29
  YearMonth.from(Date.today) # => #<DateValues::YearMonth 2026-03>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DateValues
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
@@ -65,6 +65,10 @@ module DateValues
65
65
  to_date.strftime(format)
66
66
  end
67
67
 
68
+ def to_date_range
69
+ to_date...(self + 1).to_date
70
+ end
71
+
68
72
  def to_date
69
73
  Date.new(year, month, 1)
70
74
  end
data/sig/date_values.rbs CHANGED
@@ -40,6 +40,8 @@ module DateValues
40
40
 
41
41
  def strftime: (String format) -> String
42
42
 
43
+ def to_date_range: () -> Range[Date]
44
+
43
45
  def to_date: () -> Date
44
46
 
45
47
  def as_json: (*untyped) -> String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_values
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keita Urashima