| 1 |
NAME |
| 2 |
Business::Hours - |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Business::Hours; |
| 6 |
my $hours = Business::Hours->new(); |
| 7 |
# Get a Set::IntSpan of all the business hours in the next week. |
| 8 |
# use the default business hours of 9am to 6pm localtime. |
| 9 |
$hours->business_hours_in_timespan(Start => time(), End => time()+(86400*7)); |
| 10 |
|
| 11 |
DESCRIPTION |
| 12 |
This module is a simple tool for calculating business hours in a time |
| 13 |
period. Over time, additional functionality will be added to make it |
| 14 |
easy to calculate the number of business hours between arbitrary dates. |
| 15 |
|
| 16 |
USAGE |
| 17 |
BUGS |
| 18 |
Yes |
| 19 |
|
| 20 |
SUPPORT |
| 21 |
Send email to [email protected] |
| 22 |
|
| 23 |
AUTHOR |
| 24 |
Jesse Vincent |
| 25 |
Best Practical Solutions, LLC |
| 26 |
[email protected] |
| 27 |
http://www.bestpractical.com |
| 28 |
|
| 29 |
COPYRIGHT |
| 30 |
This program is free software; you can redistribute it and/or modify it |
| 31 |
under the same terms as Perl itself. |
| 32 |
|
| 33 |
The full text of the license can be found in the LICENSE file included |
| 34 |
with this module. |
| 35 |
|
| 36 |
SEE ALSO |
| 37 |
perl(1). |
| 38 |
|
| 39 |
sample_function |
| 40 |
Usage : How to use this function/method |
| 41 |
Purpose : What it does |
| 42 |
Returns : What it returns |
| 43 |
Argument : What it wants to know |
| 44 |
Throws : Exceptions and other anomolies |
| 45 |
Comments : This is a sample subroutine header. |
| 46 |
: It is polite to include more pod and fewer comments. |
| 47 |
|
| 48 |
See Also : |
| 49 |
|
| 50 |
business_hours |
| 51 |
Set the business hours for this Business::Hours object. Takes a hash of |
| 52 |
the form : |
| 53 |
|
| 54 |
{ 0 => { Name => 'Sunday', Start => 'HH::MM', End => 'HH::MM'}, |
| 55 |
|
| 56 |
1 => { Name => 'Monday', |
| 57 |
Start => 'HH::MM', |
| 58 |
End => 'HH::MM'}, |
| 59 |
.... |
| 60 |
|
| 61 |
6 => { Name => 'Saturday', |
| 62 |
Start => 'HH::MM', |
| 63 |
End => 'HH::MM'}, |
| 64 |
}; |
| 65 |
|
| 66 |
Start and end times are of the form HH:MM. Valid times are |
| 67 |
from 00:00 to 23:59. If your hours are from 9am to 6pm, use |
| 68 |
Start => '9:00', End => '18:00'. A given day MUST have a start |
| 69 |
and end time OR may declare both Start and End to be undef, if |
| 70 |
there are no valid hours on that day. |
| 71 |
|
| 72 |
for_timespan |
| 73 |
Takes a paramhash with the following parameters |
| 74 |
|
| 75 |
Start => The start of the period in question in seconds since the epoch |
| 76 |
End => The end of the period in question in seconds since the epoch |
| 77 |
|
| 78 |
Returns a Set::IntSpan of business hours for this period of time. |
| 79 |
|