Lines 25-31
use warnings;
Link Here
|
25 |
use CGI; |
25 |
use CGI; |
26 |
use Data::ICal; |
26 |
use Data::ICal; |
27 |
use Data::ICal::Entry::Event; |
27 |
use Data::ICal::Entry::Event; |
28 |
use Date::ICal; |
28 |
use DateTime; |
|
|
29 |
use DateTime::Format::ICal; |
29 |
use Date::Calc qw (Parse_Date); |
30 |
use Date::Calc qw (Parse_Date); |
30 |
|
31 |
|
31 |
use C4::Auth; |
32 |
use C4::Auth; |
Lines 60-87
foreach my $issue ( @$issues ) {
Link Here
|
60 |
my ($year,$month,$day)=Parse_Date($issue->{'date_due'}); |
61 |
my ($year,$month,$day)=Parse_Date($issue->{'date_due'}); |
61 |
($year,$month,$day)=split /-|\/|\.|:/,$issue->{'date_due'} unless ($year && $month); |
62 |
($year,$month,$day)=split /-|\/|\.|:/,$issue->{'date_due'} unless ($year && $month); |
62 |
# Decode_Date_EU2($string)) |
63 |
# Decode_Date_EU2($string)) |
63 |
my $datestart = Date::ICal->new( |
64 |
my $datestart = DateTime->new( |
64 |
day => $day, |
65 |
day => $day, |
65 |
month => $month, |
66 |
month => $month, |
66 |
year => $year, |
67 |
year => $year, |
67 |
hour => 9, |
68 |
hour => 9, |
68 |
min => 0, |
69 |
minute => 0, |
69 |
sec => 0 |
70 |
second => 0 |
70 |
)->ical; |
71 |
); |
71 |
my $dateend = Date::ICal->new( |
72 |
my $dateend = DateTime->new( |
72 |
day => $day, |
73 |
day => $day, |
73 |
month => $month, |
74 |
month => $month, |
74 |
year => $year, |
75 |
year => $year, |
75 |
hour => 10, |
76 |
hour => 10, |
76 |
min => 0, |
77 |
minute => 0, |
77 |
sec => 0 |
78 |
second => 0 |
78 |
)->ical; |
79 |
); |
79 |
$vevent->add_properties( |
80 |
$vevent->add_properties( |
80 |
summary => "$issue->{'title'} Due", |
81 |
summary => "$issue->{'title'} Due", |
81 |
description => |
82 |
description => |
82 |
"Your copy of $issue->{'title'} barcode $issue->{'barcode'} is due back at the library today", |
83 |
"Your copy of $issue->{'title'} barcode $issue->{'barcode'} is due back at the library today", |
83 |
dtstart => $datestart, |
84 |
dtstart => DateTime::Format::ICal->format_datetime($datestart), |
84 |
dtend => $dateend, |
85 |
dtend => DateTime::Format::ICal->format_datetime($dateend), |
85 |
); |
86 |
); |
86 |
$calendar->add_entry($vevent); |
87 |
$calendar->add_entry($vevent); |
87 |
} |
88 |
} |
88 |
- |
|
|