Skip to content

Commit

Permalink
Respect Time.zone
Browse files Browse the repository at this point in the history
  • Loading branch information
smidwap committed Jan 16, 2015
1 parent 7a74d9d commit 65ad312
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/weekdays.rb
Expand Up @@ -67,7 +67,7 @@ module CoreExtensions
module Numeric
module Time
# Returns a Time object that is n number of weekdays in the future of a given Date
def weekdays_from(time = ::Time.now)
def weekdays_from(time = ::Time.current)
# -5.weekdays_from(time) == 5.weekdays_ago(time)
return self.abs.weekdays_ago(time) if self < 0

Expand All @@ -84,7 +84,7 @@ def weekdays_from(time = ::Time.now)
alias :weekdays_from_now :weekdays_from

# Returns a Time object that is n number of weekdays in the past from a given Date
def weekdays_ago(time = ::Time.now)
def weekdays_ago(time = ::Time.current)
# -5.weekdays_ago(time) == 5.weekdays_from(time)
return self.abs.weekdays_from(time) if self < 0

Expand Down

0 comments on commit 65ad312

Please sign in to comment.