Skip to content
ggodart edited this page Jan 6, 2021 · 1 revision

SchoolDays

See original

SYNOPSIS

  $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

DESCRIPTION

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.

INHERITS

INI PARAMETERS

METHODS

Method Description
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?

AUTHOR

Andrew C Baker / andrew@rekabuk.co.uk

Jeffrey C Honig / jch@honig.net

SEE ALSO

NON

Clone this wiki locally