Subject: | get_events does not work with start-min/max |
Previously, in v 0.94, the code block below worked to get calendar events between
$dtstart and $dtend. In v 1.00, this no longer works.
my $dtstart = DateTime->new( ... );
my $dtend = DateTime->new( ... );
my @events = $calendar->get_events( start-min => $dtstart, start-max => $dtend );
In the attached file, you find a working example that pulls all the events from a calendar
and prints them, then tries to get a specific event using start-min/max and fails. You
can verify that the event exists during the indicated time interval.
Installed modules:
DateTime v. 53
Net::Google::Calendar v 1.0
perl -v:
This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi
(with 46 registered patches, see perl -V for more detail)
uname -a: (debian squeeze)
Linux erdelyi 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686 GNU/Linux
Subject: | gc-r.pl |
#!/usr/bin/perl -s
use warnings;
use strict;
use Net::Google::Calendar;
use Net::Google::Calendar::Entry;
use DateTime;
our ($username, $password);
our $TIME_ZONE=DateTime::TimeZone->new(name => 'Europe/London');
my $url = 'http://www.google.com/calendar/feeds/2jdc9fhmvqge27p3soi6av3crg%40group.calendar.google.com/public/basic';
my $cal = Net::Google::Calendar->new( url => $url );
my @cal_events = $cal->get_events();
foreach my $event (@cal_events) {
print $event->title,"\n";
}
my $seminar = {
year => '2010',
month => '10',
day => '10',
hour => '16',
minute => '00',
endhour => '17',
endminute => '00',
};
my $entry = Net::Google::Calendar::Entry->new();
my $dtstart = DateTime->new(
year => $seminar->{'year'},
month => $seminar->{'month'},
day => $seminar->{'day'},
hour => $seminar->{'hour'},
minute => $seminar->{'minute'},
time_zone => $TIME_ZONE,
);
my $dtend = DateTime->new(
year => $seminar->{'year'},
month => $seminar->{'month'},
day => $seminar->{'day'},
hour => $seminar->{'endhour'},
minute => $seminar->{'endminute'},
time_zone => $TIME_ZONE,
);
my @events = $cal->get_events(
'start-min' => $dtstart,
'start-max' => $dtend,
);
for (@events) {
print "$_,\n";
}
exit 0;