business-days 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/business-days.rb +2 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3bbc892749b3892c56eff2cb8f86a7f7f1bd39e
4
- data.tar.gz: ca2333f85d9465b9bb70d429784611e46fd0a1a5
3
+ metadata.gz: 644660e03df8746700c94b19abd9ac7eb587263a
4
+ data.tar.gz: fc0d905200460b9f4c023176afa4f460e84eb327
5
5
  SHA512:
6
- metadata.gz: 39675014fef8f85089cfad6a484c2890e2bdd757998b9bd1cdb36b057fc46b57d17ce6a57331d8552f5beb531fcf95238fa6622b3261f9f2fb773f4a85fc3077
7
- data.tar.gz: 3f1df86059f02b4226e9d192dc6ab2f25e7a79704de010dbe0279dd972c44d8a86843af13288bffd304d289eedadbaa4daae8e3bc5da45e41f82781d2115d2dc
6
+ metadata.gz: 750bb44d5a33363c944c0a0c0669c306e4b0003e976f57342e582e15d1b7b3bcd46a33e5f457efa87280f212aa4c4ead0acd58a3f7a1d14403c29723b8809287
7
+ data.tar.gz: 265974f4efe1afc998939434952af67857a62a0a468bd77a1d5293d818fbdde6bbc04e557942b922884bb9eb5ea02c14374918f9c83462dbe8f0faae3500c14a
data/lib/business-days.rb CHANGED
@@ -34,7 +34,7 @@ class BusinessDaysSingleton
34
34
  # @param days [Integer] how many business days to add to given time.
35
35
  # @param time [Time] the start time in UTC from which the business days will be added.
36
36
  # @param reference [Time] the reference time in UTC from which we will compute daylight saving.
37
- # @return [Date] the computed business day
37
+ # @return [Time] the computed business day in UTC time (at midnight in Brasilia time)
38
38
  def business_days_from_utc_time(days, time, reference=nil)
39
39
  # Set reference to given time if no reference is passed
40
40
  if reference.nil?
@@ -56,7 +56,7 @@ class BusinessDaysSingleton
56
56
  end
57
57
  end
58
58
 
59
- date
59
+ (date.to_time.utc.midnight - offset.to_i.hours)
60
60
  end
61
61
 
62
62
  # Check if the given date is a business day
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business-days
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allan Costa