business_date_calculator 0.1.4 → 0.1.5
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 +3 -2
- 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: 76736416593db5462eed799dc6f31ef5522b7f30
|
4
|
+
data.tar.gz: 20a36007d246e1b449e66e456b3a0242dcdfddcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af830900695fbaa8c0f27b15062cd49c0199e993ddae8c1a08faef4cfc6851c18e3e0d36c70ed8c3a141cdee3a1ba76e905ae17fc18b7db9dfc2ea23e9ad1be0
|
7
|
+
data.tar.gz: ebd51df76d57938987f1cea71d415dbac1e71929e9fd7c944b951b388444b6a68fa0b3d4be6778c3fed3a1e01dfd594f544d299138a0b7215082900e2da2c9f0
|
data/Gemfile
CHANGED
@@ -42,12 +42,13 @@ module BusinessDateCalculator
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def advance(date, n, convention = :following)
|
45
|
+
def advance(date, n, convention = :following, margin = 30)
|
46
46
|
date = date.to_date
|
47
47
|
range_check(date)
|
48
48
|
index = adjusted_date_index(date, convention) + n
|
49
49
|
if index < 0
|
50
|
-
build(date + (index -
|
50
|
+
build(date + (index - margin).days, @end_date, @holidays)
|
51
|
+
return advance(date, n, convention, margin + 30)
|
51
52
|
end
|
52
53
|
@business_dates[adjusted_date_index(date, convention) + n]
|
53
54
|
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.5
|
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: 2018-11-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.
|
123
|
+
rubygems_version: 2.6.8
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A Ruby Library for dealing with business calendar.
|