timely 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/timely/date_range.rb +2 -2
- data/lib/timely/version.rb +1 -1
- data/spec/date_range_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 382904d08678605d938cd0d941705332863f14a1d4c35b2cb8b32e392512ebed
|
4
|
+
data.tar.gz: 4b3fe1a94eb20f44f5d7936ee74b2c6a318876842941802d1dc21730ebf9601b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afff189e47475c6735567715412ed9b18bdfcda0d3e18d47a1380e5638fe4761ca1e557258bdd94524d2de8c416b9fe6af2e5d1e0da7b345300263b8ef991165
|
7
|
+
data.tar.gz: 7992375af6e06869b694094b4219b7e59ce47cb902c9c4347d894d90eb9f208e44cb8d57addaa9797258c0b014520e7a5817a59c9b54535f1646ba586f6c5f97
|
data/CHANGELOG.md
CHANGED
data/lib/timely/date_range.rb
CHANGED
@@ -58,8 +58,8 @@ module Timely
|
|
58
58
|
if first && last
|
59
59
|
if first == last
|
60
60
|
first.strftime(fmt)
|
61
|
-
elsif first
|
62
|
-
if first.month == last.month
|
61
|
+
elsif first == first.at_beginning_of_month && last == last.at_end_of_month
|
62
|
+
if first.year == last.year && first.month == last.month
|
63
63
|
first.strftime(month_fmt)
|
64
64
|
else
|
65
65
|
"#{first.strftime(month_fmt)} to #{last.strftime(month_fmt)}"
|
data/lib/timely/version.rb
CHANGED
data/spec/date_range_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Timely::DateRange do
|
|
27
27
|
expect(Timely::DateRange.new('2000-01-04'.to_date, '2000-01-06'.to_date).to_s).to eq '2000-01-04 to 2000-01-06 (inclusive)'
|
28
28
|
expect(Timely::DateRange.new('2000-01-01'.to_date, '2000-05-31'.to_date).to_s).to eq 'Jan 2000 to May 2000'
|
29
29
|
expect(Timely::DateRange.new('2000-01-01'.to_date, '2000-01-31'.to_date).to_s).to eq 'Jan 2000'
|
30
|
-
expect(Timely::DateRange.new('2000-01-01'.to_date, '2001-01-31'.to_date).to_s).to eq '2000
|
30
|
+
expect(Timely::DateRange.new('2000-01-01'.to_date, '2001-01-31'.to_date).to_s).to eq 'Jan 2000 to Jan 2001'
|
31
31
|
Date::DATE_FORMATS[:short] = '%Y-%m-%d'
|
32
32
|
expect(Timely::DateRange.to_s('2000-01-01'.to_date, nil)).to eq 'on or after 2000-01-01'
|
33
33
|
expect(Timely::DateRange.to_s(nil, '2000-01-31'.to_date)).to eq 'on or before 2000-01-31'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|