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.
- checksums.yaml +4 -4
- data/lib/business-days.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 644660e03df8746700c94b19abd9ac7eb587263a
|
4
|
+
data.tar.gz: fc0d905200460b9f4c023176afa4f460e84eb327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 [
|
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
|