| View script | License | Download documentation as: HTML or editable |
| Download script | History | Other scripts by: sunanda |
18-Feb 19:48 UTC
[0.061] 13.063k
[0.061] 13.063k
Documentation for: work-days.r
Author: Sunanda
Version: 1.0
Date: 18-feb-2007
1. calculate working daysThis script calculates the number of working days between two dates. 2. examples:
do %work-days.r
calc-work-days now now + 7 []
== 5 ;; working weeks have five working days
calc-work-days 1-jan-2008 5-jan-2008 []
== 3 ;; tue to sat is three working days (wed, thu, fri)
calc-work-days/non 1-jan-2008 5-jan-2008 []
== 1 ;; tue to sat is one non-working day (sat)
3. usage3.1. starting the scriptdo %work-days.r 3.2. functionsThere is just one function with one optional refinement: 3.2.1. calc-work-days start, end, holidaysWhere:
3.3. /non refinement"inverts" the output -- ie output is number of non-working days in the range. 4. definitions / specification
5. acknowledgements / creditsThis script was written in response to a challenge on the REBOL Mailing List to produce a better script. Thanks to Ed O'Conner for providing that initial impetus. His challenge came from seeing a RUBY version of the script. It is instructive to compare all the approaches used. Last updated: 18-Feb-2007 |