diff --git a/C4/Calendar.pm b/C4/Calendar.pm
index 657d4b7f5d..2f1f720548 100644
--- a/C4/Calendar.pm
+++ b/C4/Calendar.pm
@@ -104,7 +104,9 @@ sub _init {
while (my $row = $repeatable->fetchrow_hashref) {
my $key = $row->{month} . "/" . $row->{day};
$day_month_holidays{$key}{title} = $row->{title};
- $day_month_holidays{$key}{description} = $row->{description}
+ $day_month_holidays{$key}{description} = $row->{description};
+ $day_month_holidays{$key}{day} = sprintf("%02d", $row->{day});
+ $day_month_holidays{$key}{month} = sprintf("%02d", $row->{month});
}
$self->{'day_month_holidays'} = \%day_month_holidays;
@@ -117,6 +119,8 @@ sub _init {
while (my ($day, $month, $year, $title, $description) = $special->fetchrow) {
$exception_holidays{"$year/$month/$day"}{title} = $title;
$exception_holidays{"$year/$month/$day"}{description} = $description;
+ $exception_holidays{"$year/$month/$day"}{date} =
+ sprintf("%04d-%02d-%02d", $year, $month, $day);
}
$self->{'exception_holidays'} = \%exception_holidays;
@@ -125,6 +129,8 @@ sub _init {
while (my ($day, $month, $year, $title, $description) = $special->fetchrow) {
$single_holidays{"$year/$month/$day"}{title} = $title;
$single_holidays{"$year/$month/$day"}{description} = $description;
+ $single_holidays{"$year/$month/$day"}{date} =
+ sprintf("%04d-%02d-%02d", $year, $month, $day);
}
$self->{'single_holidays'} = \%single_holidays;
return $self;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl
index e3c512f423..d8b0e064c0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tmpl
@@ -357,7 +357,7 @@ h1 select { width: 20em; }
Exceptions
- | Year/Month/Day |
+ Date |
Title |
Description |
@@ -365,7 +365,7 @@ h1 select { width: 20em; }
- |
+ |
|
|
@@ -405,7 +405,11 @@ h1 select { width: 20em; }
+
+ | Day/Month |
+
Month/Day |
+
Title |
Description |
@@ -413,7 +417,7 @@ h1 select { width: 20em; }
- |
+ |
|
|
@@ -427,7 +431,7 @@ h1 select { width: 20em; }
- | Year/Month/Day |
+ Date |
Title |
Description |
@@ -435,7 +439,7 @@ h1 select { width: 20em; }
- |
+ |
|
|
diff --git a/tools/holidays.pl b/tools/holidays.pl
index 6cc26fa28a..d3a450c42e 100755
--- a/tools/holidays.pl
+++ b/tools/holidays.pl
@@ -76,8 +76,18 @@ foreach my $weekday (keys %$week_days_holidays) {
my $day_month_holidays = $calendar->get_day_month_holidays();
my @day_month_holidays;
foreach my $monthDay (keys %$day_month_holidays) {
+ # Determine date format on month and day.
+ my $day_monthdate;
+ if (C4::Context->preference("dateformat") eq "metric") {
+ $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}";
+ } elsif (C4::Context->preference("dateformat") eq "us") {
+ $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}";
+ } else {
+ $day_monthdate = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
+ }
my %day_month;
%day_month = (KEY => $monthDay,
+ DATE => $day_monthdate,
TITLE => $day_month_holidays->{$monthDay}{title},
DESCRIPTION => $day_month_holidays->{$monthDay}{description});
push @day_month_holidays, \%day_month;
@@ -86,8 +96,10 @@ foreach my $monthDay (keys %$day_month_holidays) {
my $exception_holidays = $calendar->get_exception_holidays();
my @exception_holidays;
foreach my $yearMonthDay (keys %$exception_holidays) {
+ my $exceptiondate = C4::Dates->new($exception_holidays->{$yearMonthDay}{date}, "iso");
my %exception_holiday;
%exception_holiday = (KEY => $yearMonthDay,
+ DATE => $exceptiondate->output("syspref"),
TITLE => $exception_holidays->{$yearMonthDay}{title},
DESCRIPTION => $exception_holidays->{$yearMonthDay}{description});
push @exception_holidays, \%exception_holiday;
@@ -96,8 +108,10 @@ foreach my $yearMonthDay (keys %$exception_holidays) {
my $single_holidays = $calendar->get_single_holidays();
my @holidays;
foreach my $yearMonthDay (keys %$single_holidays) {
+ my $holidaydate = C4::Dates->new($single_holidays->{$yearMonthDay}{date}, "iso");
my %holiday;
%holiday = (KEY => $yearMonthDay,
+ DATE => $holidaydate->output("syspref"),
TITLE => $single_holidays->{$yearMonthDay}{title},
DESCRIPTION => $single_holidays->{$yearMonthDay}{description});
push @holidays, \%holiday;