Skip to content

Commit

Permalink
Add docs for calculating previous/next business time
Browse files Browse the repository at this point in the history
This is a common question answered by business-hours gems, so we should
show how to answer it.
  • Loading branch information
craiglittle committed May 17, 2017
1 parent 34aa146 commit 0218a8e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Biz.time(2, :hours).after(Time.utc(2015, 12, 25, 9, 30))
# Calculations can be performed in seconds, minutes, hours, or days
Biz.time(1, :day).after(Time.utc(2015, 1, 8, 10))

# Find the previous business time
Biz.time(0, :hours).before(Time.utc(2016, 1, 8, 6))

# Find the next business time
Biz.time(0, :hours).after(Time.utc(2016, 1, 8, 20))

# Find the amount of business time between two times
Biz.within(Time.utc(2015, 3, 7), Time.utc(2015, 3, 14)).in_seconds

Expand Down

0 comments on commit 0218a8e

Please sign in to comment.