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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e83654ea4c43d082a16fab33d1ab857ac3640e8
4
- data.tar.gz: 77f2a1cecea657f860eabda0dacaa43118c4ff0e
3
+ metadata.gz: e542cbd6069fa1423aea911ff424413a90d3a3df
4
+ data.tar.gz: 1dad0a2475c603db0f8e127ece8d329b80824c71
5
5
  SHA512:
6
- metadata.gz: 9301f09efb5758331ce7bc9051ca71fc8a4e723d823a4426eab8beebad12ef03ff74080a93c941aee5b320c4db23db036cc7b82537b2c9b703c0ad23f0b31a9e
7
- data.tar.gz: 4342c8c8f7b81708da7a9c8e32c2c3b034ca754db880fdb5a8c353d691af490c3e272c89510add61db69e72f4e16fc7cbf1260a2b3565fb83b48b57992861a99
6
+ metadata.gz: e525f6d2669c84308734da0ce7c3ae67d75401fb181a1a4f48757a96319593b0e8551e31c22ec7ad0bedcdae060f63cf4c1787604a6bfdc8bc274370963bf89d
7
+ data.tar.gz: 8e5331844329f0bba7396da1e5b0c46cbe327a41ed73ff6bd9c0e9fda02f65ee96953f5219751d296f2009391fc592cdf1241cb3d5266c8bc41f4bcc2b4c4a57
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
-
2
+ # ruby '2.2.5'
3
3
  # Specify your gem's dependencies in business_date_calculator.gemspec
4
4
  gemspec
@@ -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
@@ -1,3 +1,3 @@
1
1
  module BusinessDateCalculator
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  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.3
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: 2015-07-01 00:00:00.000000000 Z
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.3
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.