https://github.com/coderberry/date_extensions
Simple date extensions to get next business day
https://github.com/coderberry/date_extensions
Last synced: 15 days ago
JSON representation
Simple date extensions to get next business day
- Host: GitHub
- URL: https://github.com/coderberry/date_extensions
- Owner: coderberry
- License: mit
- Created: 2009-11-02T17:59:33.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-11-02T18:05:24.000Z (over 16 years ago)
- Last Synced: 2025-01-10T21:04:07.427Z (over 1 year ago)
- Language: Ruby
- Homepage: http://www.solidcoresolutions.com
- Size: 74.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
Date Extensions
===============
Simple plugin to extend the Date class in order to get the next business day from a date.
Example
=======
Use an existing business day:
>> d = Date.civil(2009,11,2)
=> Mon, 02 Nov 2009
>> d.to_next_business_day
=> Mon, 02 Nov 2009
Use a holiday:
>> d = Date.civil(2009,12,25)
=> Fri, 25 Dec 2009
>> d.to_next_business_day
=> Mon, 28 Dec 2009
Use a weekend:
>> d = Date.civil(2009,11,7)
=> Sat, 07 Nov 2009
>> d.to_next_business_day
=> Mon, 09 Nov 2009
Copyright (c) 2009 Eric Berry, released under the MIT license