business_date_calculator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/business_date_calculator/calendar.rb +10 -0
- data/lib/business_date_calculator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e94487cf6161751aebfeff6d6686ce0f6229113
|
4
|
+
data.tar.gz: 6ed02edef1bdc0f79d4e365f5aa32ac3cef03a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed835a0d32aa91cf51332f115fb8c880f725765d14e65fca3b5a96bc1fda2bcbfd3aff177a076cd9dcae703ca0ab330c82a84cf7f13ffaa62ba43779111f0766
|
7
|
+
data.tar.gz: 7381367cfd2db05635d2761e6515e4cd7a9396449ccebde9a73a5ec2971cd8671edcd182b641a831e60be71c8bdbdb4a4764ed1d1b1e9ce24361c3ecc71052ab
|
@@ -47,6 +47,16 @@ module BusinessDateCalculator
|
|
47
47
|
@business_dates[adjusted_date_index(date, convention) + n]
|
48
48
|
end
|
49
49
|
|
50
|
+
def last_day_of_previous_month(date)
|
51
|
+
m = date.month
|
52
|
+
y = date.year
|
53
|
+
if m == 1
|
54
|
+
m = 0
|
55
|
+
y = y -1
|
56
|
+
end
|
57
|
+
adjust(Date.civil(y, (m - 1), -1), :preceding)
|
58
|
+
end
|
59
|
+
|
50
60
|
protected
|
51
61
|
|
52
62
|
def build(start_date, end_date, holidays)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_date_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Pérez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.4.3
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A Ruby Library for dealing with business calendar.
|