timely 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -22
- data/lib/timely/rails/period.rb +25 -0
- data/lib/timely/version.rb +1 -1
- data/timely.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76d53f7128d1f8fefc57f6c424ba275bc4ecb2a417ec36f81424b9e71b2859d8
|
4
|
+
data.tar.gz: 224b5a5144121bb69d2c01cd0dd79f21a70a58a2d92fe206ee58fc3ddb3cb809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6210ba90bcca9ee930c78e5c5487fd9f30145ec32a15b896ebd1aaf0428bd9b8d8a0c98df95b443d9c2935e66efffd9788bf48428f5cbf5c0afb5b40c1f6f30
|
7
|
+
data.tar.gz: 7310aa84aadf17a0159652fc11c84295966fdf552759f4dfabfa169895768f8508f35be1a59d6bde4681c11e84e15989c2158024317eaeabd694969271c5b133
|
data/CHANGELOG.md
CHANGED
@@ -1,77 +1,85 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.14.0
|
4
|
+
|
5
|
+
- [TF-36] Add to_seconds method in Period class
|
6
|
+
|
7
|
+
## 0.13.0
|
8
|
+
|
9
|
+
- [PLAT-1175] Update to Ruby 3.2
|
10
|
+
|
3
11
|
## 0.12.0
|
4
12
|
|
5
|
-
|
13
|
+
- [PLAT-954] Handle additional `to_s` deprecation on Rails 7
|
6
14
|
|
7
15
|
## 0.11.0
|
8
16
|
|
9
|
-
|
17
|
+
- [PLAT-346] Handle `to_s` deprecation on Rails 7
|
10
18
|
|
11
19
|
## 0.10.0
|
12
20
|
|
13
|
-
|
21
|
+
- [PLAT-183] Publish coveralls with github actions add ruby 3.1 to test matrix
|
14
22
|
|
15
23
|
## 0.9.0
|
16
24
|
|
17
|
-
|
25
|
+
- [TT-8614] Update to build with github actions / ruby 3.0 / rails 6.1
|
18
26
|
|
19
27
|
## 0.8.0
|
20
28
|
|
21
|
-
|
22
|
-
|
29
|
+
- [TT-6441] Turns out we don't actually need time difference in QT
|
30
|
+
- [TT-6661] Fix issue when detecting intersecting date groups
|
23
31
|
|
24
32
|
## 0.7.0
|
25
33
|
|
26
|
-
|
34
|
+
- [TT-6441] Due to TimeDifference being unmaintained bring it into the timely library
|
27
35
|
|
28
36
|
## 0.6.0
|
29
37
|
|
30
|
-
|
31
|
-
|
32
|
-
|
38
|
+
- [TT-6402] Require date group weekdays bit field to be not null/nil
|
39
|
+
IMPORTANT: Rails projects must add a migration to make this field not null!
|
40
|
+
- [TT-6401] Remove Rails 3 support, unused methods
|
33
41
|
|
34
42
|
## 0.5.0
|
35
43
|
|
36
|
-
|
44
|
+
- [TT-6193] Date group scopes for more efficient searches/restrictions
|
37
45
|
|
38
46
|
## 0.4.2
|
39
47
|
|
40
|
-
|
48
|
+
- [TT-5794] Fix belongs_to associations are not explicitly marked optional
|
41
49
|
|
42
50
|
## 0.4.1
|
43
51
|
|
44
|
-
|
52
|
+
- [TT-5674] Make multi year date format friendlier
|
45
53
|
|
46
54
|
## 0.4.0
|
47
55
|
|
48
|
-
|
56
|
+
- [TT-5648] Fix date_range to string when a single month covers a year period
|
49
57
|
|
50
58
|
## 0.3.4
|
51
59
|
|
52
|
-
|
60
|
+
- [TT-4812] Remove bootstrap class from calender tag
|
53
61
|
|
54
62
|
## 0.3.3
|
55
63
|
|
56
|
-
|
64
|
+
- Skipped due to mis-tagged version
|
57
65
|
|
58
66
|
## 0.3.2
|
59
67
|
|
60
|
-
|
68
|
+
- [TT-4716] Better exception message when a range is invalid
|
61
69
|
|
62
70
|
## 0.3.1
|
63
71
|
|
64
|
-
|
72
|
+
- Using Fixnum is deprecated
|
65
73
|
|
66
74
|
## 0.3.0
|
67
75
|
|
68
|
-
|
69
|
-
|
76
|
+
- Add time zone awareness for Time#on (e.g. Rails)
|
77
|
+
- Required Timely.load to load overrides
|
70
78
|
|
71
79
|
## 0.2.0
|
72
80
|
|
73
|
-
|
81
|
+
- Rails 5 support
|
74
82
|
|
75
83
|
## 0.1.0
|
76
84
|
|
77
|
-
|
85
|
+
- Initial release
|
data/lib/timely/rails/period.rb
CHANGED
@@ -29,5 +29,30 @@ module Timely
|
|
29
29
|
def to_s
|
30
30
|
"#{number} #{units.to_s.gsub('_', '')}"
|
31
31
|
end
|
32
|
+
|
33
|
+
def to_seconds
|
34
|
+
case units
|
35
|
+
when :seconds
|
36
|
+
number
|
37
|
+
when :minutes
|
38
|
+
number.minute.in_seconds
|
39
|
+
when :hours
|
40
|
+
number.hour.in_seconds
|
41
|
+
when :days
|
42
|
+
number.day.in_seconds
|
43
|
+
when :weeks
|
44
|
+
number.week.in_seconds
|
45
|
+
when :months
|
46
|
+
number.month.in_seconds
|
47
|
+
when :years
|
48
|
+
number.year.in_seconds
|
49
|
+
when :calendar_days
|
50
|
+
::Time.now.advance(days: number - 1).end_of_day - ::Time.now
|
51
|
+
when :calendar_months
|
52
|
+
::Time.now.advance(months: number - 1).end_of_month - ::Time.now
|
53
|
+
when :calendar_years
|
54
|
+
::Time.now.advance(years: number - 1).end_of_year - ::Time.now
|
55
|
+
end
|
56
|
+
end
|
32
57
|
end
|
33
58
|
end
|
data/lib/timely/version.rb
CHANGED
data/timely.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.files = Dir["CHANGELOG.md", "README.md", "timely.gemspec", "lib/**/*"]
|
19
19
|
spec.executables = []
|
20
20
|
spec.require_paths = ['lib']
|
21
|
-
spec.required_ruby_version = '>=
|
21
|
+
spec.required_ruby_version = '>= 3.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'activerecord', '>=6', '<8'
|
24
24
|
spec.add_development_dependency 'activesupport', '>=6', '<8'
|
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
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -253,14 +253,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
253
253
|
requirements:
|
254
254
|
- - ">="
|
255
255
|
- !ruby/object:Gem::Version
|
256
|
-
version: '
|
256
|
+
version: '3.0'
|
257
257
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
258
|
requirements:
|
259
259
|
- - ">="
|
260
260
|
- !ruby/object:Gem::Version
|
261
261
|
version: '0'
|
262
262
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
263
|
+
rubygems_version: 3.4.1
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: Set of time, date, weekday related methods.
|