business_date_calculator 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/business_date_calculator/calendar.rb +5 -1
- 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: e542cbd6069fa1423aea911ff424413a90d3a3df
|
4
|
+
data.tar.gz: 1dad0a2475c603db0f8e127ece8d329b80824c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e525f6d2669c84308734da0ce7c3ae67d75401fb181a1a4f48757a96319593b0e8551e31c22ec7ad0bedcdae060f63cf4c1787604a6bfdc8bc274370963bf89d
|
7
|
+
data.tar.gz: 8e5331844329f0bba7396da1e5b0c46cbe327a41ed73ff6bd9c0e9fda02f65ee96953f5219751d296f2009391fc592cdf1241cb3d5266c8bc41f4bcc2b4c4a57
|
data/Gemfile
CHANGED
@@ -45,6 +45,10 @@ module BusinessDateCalculator
|
|
45
45
|
def advance(date, n, convention = :following)
|
46
46
|
date = date.to_date
|
47
47
|
range_check(date)
|
48
|
+
index = adjusted_date_index(date, convention) + n
|
49
|
+
if index < 0
|
50
|
+
build(date + (index - 3).days, @end_date, @holidays)
|
51
|
+
end
|
48
52
|
@business_dates[adjusted_date_index(date, convention) + n]
|
49
53
|
end
|
50
54
|
|
@@ -53,7 +57,7 @@ module BusinessDateCalculator
|
|
53
57
|
y = date.year
|
54
58
|
if m == 1
|
55
59
|
m = 0
|
56
|
-
y = y -1
|
60
|
+
y = y - 1
|
57
61
|
end
|
58
62
|
adjust(Date.civil(y, (m - 1), -1), :preceding)
|
59
63
|
end
|
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.4
|
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:
|
11
|
+
date: 2016-10-26 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.4.
|
123
|
+
rubygems_version: 2.4.8
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A Ruby Library for dealing with business calendar.
|