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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aff6be7b253d234442741fa3df9aa7a141135e0a
4
- data.tar.gz: 0735f63d53c579dd04e13903900cbcd85c4f9f96
3
+ metadata.gz: 5e94487cf6161751aebfeff6d6686ce0f6229113
4
+ data.tar.gz: 6ed02edef1bdc0f79d4e365f5aa32ac3cef03a0a
5
5
  SHA512:
6
- metadata.gz: 82cf1f4b0c8130630b89821fa228da31617fdfe8ef308d642815ad931fdfcc5d5ee588e5485b3b335aefe440209fc5fc346788072293f2c8b30cbba5857521a1
7
- data.tar.gz: c2e1a1322d81a0a49ee47f261e116e14292e3f877c6517c952268d08bd06cad2056c55fbffcb8f719c24c37cc3549ccd2829e30d7e6437fd467111db6639ff2f
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)
@@ -1,3 +1,3 @@
1
1
  module BusinessDateCalculator
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
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.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-06-03 00:00:00.000000000 Z
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.2.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.