SchoolDays.pm |
$school1 = new SchoolDays("EACMSI", # School name
"9/3-12/19", # School dates
"9/30,10/9,10/10,10/13,11/11,11/13,11/14,11/26-11/28");
if ($school1->is_school_today()) {
...
} elsif ($school1->is_school_tomorrow()) {
...
}
$school1->is_school_day("mm/dd/yy"); # Date format is $config_parms{"date_format"};
$school1->is_school_night("mm/dd/yy"); $ Can also use an ISO8601 date
$school1->set_logging(0|1); # Logging
These function will calculate if Today or Tomorrow are schooldays. Multiple schools are supported. A list of term dates and an optional list of mid-term holidays are required for each school.
new
Initialize with school name, session dates, and exceptions
_get_epoch_date
Return ISO8601 date for today
_hr_date
Return human readable date
_log
Log a message
set_logging
Toggle logging
is_schoolday
Is the supplied day a school day
is_schoolnight
Is the supplied day a school night
is_school_today
Is today a school day?
is_school_tomorrow
Is tomorrow a school day?
NONE
Andrew C Baker / andrew@rekabuk.co.uk
Jeffrey C Honig / jch@honig.net
NONE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SchoolDays.pm |