<<

NAME

C4::Calendar::Calendar - Koha module dealing with holidays.

SYNOPSIS

    use C4::Calendar::Calendar;

DESCRIPTION

This package is used to deal with holidays. Through this package, you can set all kind of holidays for the library.

FUNCTIONS

new

  $calendar = C4::Calendar->new(branchcode => $branchcode);

Each library branch has its own Calendar. $branchcode specifies which Calendar you want.

get_week_days_holidays

   $week_days_holidays = $calendar->get_week_days_holidays();

Returns a hash reference to week days holidays.

get_day_month_holidays

   $day_month_holidays = $calendar->get_day_month_holidays();

Returns a hash reference to day month holidays.

get_exception_holidays

    $exception_holidays = $calendar->exception_holidays();

Returns a hash reference to exception holidays. This kind of days are those which stands for a holiday, but you wanted to make an exception for this particular date.

get_single_holidays

    $single_holidays = $calendar->get_single_holidays();

Returns a hash reference to single holidays. This kind of holidays are those which happend just one time.

insert_week_day_holiday

    insert_week_day_holiday(weekday => $weekday,
                            title => $title,
                            description => $description);

Inserts a new week day for $self->{branchcode}.

$day Is the week day to make holiday.

$title Is the title to store for the holiday formed by $year/$month/$day.

$description Is the description to store for the holiday formed by $year/$month/$day.

insert_day_month_holiday

    insert_day_month_holiday(day => $day,
                             month => $month,
                             title => $title,
                             description => $description);

Inserts a new day month holiday for $self->{branchcode}.

$day Is the day month to make the date to insert.

$month Is month to make the date to insert.

$title Is the title to store for the holiday formed by $year/$month/$day.

$description Is the description to store for the holiday formed by $year/$month/$day.

insert_single_holiday

    insert_single_holiday(day => $day,
                          month => $month,
                          year => $year,
                          title => $title,
                          description => $description);

Inserts a new single holiday for $self->{branchcode}.

$day Is the day month to make the date to insert.

$month Is month to make the date to insert.

$year Is year to make the date to insert.

$title Is the title to store for the holiday formed by $year/$month/$day.

$description Is the description to store for the holiday formed by $year/$month/$day.

insert_exception_holiday

    insert_exception_holiday(day => $day,
                             month => $month,
                             year => $year,
                             title => $title,
                             description => $description);

Inserts a new exception holiday for $self->{branchcode}.

$day Is the day month to make the date to insert.

$month Is month to make the date to insert.

$year Is year to make the date to insert.

$title Is the title to store for the holiday formed by $year/$month/$day.

$description Is the description to store for the holiday formed by $year/$month/$day.

ModWeekdayholiday

    ModWeekdayholiday(weekday =>$weekday,
                      title => $title,
                      description => $description)

Modifies the title and description of a weekday for $self->{branchcode}.

$weekday Is the title to update for the holiday.

$description Is the description to update for the holiday.

ModDaymonthholiday

    ModDaymonthholiday(day => $day,
                       month => $month,
                       title => $title,
                       description => $description);

Modifies the title and description for a day/month holiday for $self->{branchcode}.

$day The day of the month for the update.

$month The month to be used for the update.

$title The title to be updated for the holiday.

$description The description to be update for the holiday.

ModSingleholiday

    ModSingleholiday(day => $day,
                     month => $month,
                     year => $year,
                     title => $title,
                     description => $description);

Modifies the title and description for a single holiday for $self->{branchcode}.

$day Is the day of the month to make the update.

$month Is the month to make the update.

$year Is the year to make the update.

$title Is the title to update for the holiday formed by $year/$month/$day.

$description Is the description to update for the holiday formed by $year/$month/$day.

ModExceptionholiday

    ModExceptionholiday(day => $day,
                        month => $month,
                        year => $year,
                        title => $title,
                        description => $description);

Modifies the title and description for an exception holiday for $self->{branchcode}.

$day Is the day of the month for the holiday.

$month Is the month for the holiday.

$year Is the year for the holiday.

$title Is the title to be modified for the holiday formed by $year/$month/$day.

$description Is the description to be modified for the holiday formed by $year/$month/$day.

delete_holiday

    delete_holiday(weekday => $weekday
                   day => $day,
                   month => $month,
                   year => $year);

Delete a holiday for $self->{branchcode}.

$weekday Is the week day to delete.

$day Is the day month to make the date to delete.

$month Is month to make the date to delete.

$year Is year to make the date to delete.

isHoliday

    $isHoliday = isHoliday($day, $month $year);

$day Is the day to check whether if is a holiday or not.

$month Is the month to check whether if is a holiday or not.

$year Is the year to check whether if is a holiday or not.

addDate

    my ($day, $month, $year) = $calendar->addDate($date, $offset)

$date is a C4::Dates object representing the starting date of the interval.

$offset Is the number of days that this function has to count from $date.

daysBetween

    my $daysBetween = $calendar->daysBetween($startdate, $enddate)

$startdate and $enddate are C4::Dates objects that define the interval.

Returns the number of non-holiday days in the interval. useDaysMode syspref has no effect here.

AUTHOR

Koha Physics Library UNLP <matias_veleda@hotmail.com>

<<