<<

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);

$branchcode Is the branch code wich you want to use calendar.

change_branchcode
    $calendar->change_branchcode(branchcode => $branchcode)

Change the calendar branch code. This means to change the holidays structure.

$branchcode Is the branch code wich you want to use calendar.

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.

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>

<<