Fwd: issues with Data::ICal::DateTime and possible DateTime::Set
[email protected] ("Flavio S. Glock") Fri, 18 Aug 2017 19:27:02 +0200
| Newsgroups | perl.datetime |
|---|---|
| Message-ID | <CAHMRfDz4KdRLdAv7PQXbRTJWKMQihdj6M_TM4TGvHoxQWx=POA@mail.gmail.com> |
--001a1140f6eaeaeb8805570a6f33
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
(forwarding to DateTime list because this looks interesting)
I've created this test - https://gist.github.com/fglock/
cf1117ad000b41d9e5dbee6fa8b78993
this fails (set time zone implicitly through dtstart):
$a =3D DateTime::Event::ICal->recur(
dtstart =3D> $dt19970902T090000_tz ,
freq =3D> 'daily',
count =3D> 10 )
->intersection( $period_1995_1999 );
this other test works (time zone is set explicitly for the whole
recurrence):
$a =3D DateTime::Event::ICal->recur(
dtstart =3D> $dt19970902T090000_tz ,
freq =3D> 'daily',
count =3D> 10 )
->set_time_zone( "America/New_York" )
->intersection( $period_1995_1999 );
I believe this is the correct behaviour (though it should warn!), because
http://www.ietf.org/rfc/rfc2445.txt
says:
<quote>
Dawson & Stenerson Standards Track [Page 117]
=0C
RFC 2445 iCalendar November 1998
The "DTSTART" and "DTEND" property pair or "DTSTART" and "DURATION"
property pair, specified within the iCalendar object defines the
first instance of the recurrence. When used with a recurrence rule,
the "DTSTART" and "DTEND" properties MUST be specified in local time
and the appropriate set of "VTIMEZONE" calendar components MUST be
included. For detail on the usage of the "VTIMEZONE" calendar
component, see the "VTIMEZONE" calendar component definition.</quote>
I *think* DateTime::Event::ICal is doing the right thing, but the
module documentation is not clear:
<quote>
This method takes parameters which correspond to the rule parts
specified in section 4.3.10 of RFC 2445. Rather than rewrite that RFC
here, you are encouraged to read that first if you want to understand
what all these parameters represent.
</quote>
It *could* as well also use the time_zone from "dtstart".
Simon: do you think this explains the problem, and can this can be
fixed in your module maybe?
Fl=C3=A1vio S. Glock
2017-08-18 18:28 GMT+02:00 Flavio S. Glock <[email protected]>:
> just to confirm, I did a fresh install and I get:
>
> t/01.parse_recurring.t ...... 1/18
> # Failed test at t/01.parse_recurring.t line 25.
> # got: 'floating'
> # expected: 'Europe/London'
>
> I'm investigating a bit
>
> Fl=C3=A1vio
>
>
> 2017-08-18 17:33 GMT+02:00 Th.J. van Hoesel <[email protected]>:
> > just fiddling along, it works if I first install
> FGLOCK/DateTime-Event-Recurrence-0.16
> >
> >> On 18 Aug 2017, at 15:34, Th.J. van Hoesel <[email protected]>
> wrote:
> >>
> >> Hi Fl=C3=A1vio, Hello Simon,
> >>
> >> i've some issues with installing Data::Ical::DateTime and I can not
> exactly say who is in the right or who is in the wrong, that would requir=
e
> more investigation.
> >>
> >> Data::Ical::DateTime is depending on DateTime::Event::Recurrence, with
> is dependent on DateTime::Set. When that was changed back in november 201=
5,
> that is when Data::ICal::DateTime started failing on CPAN testers.
> >>
> >> Maybe one does a wrong call and should actually had expected to get
> "floating" timezones, maybe one does expected that his timezone from the
> .ics test file would be honoured.
> >>
> >> Could you please be so kind and have a look, you probably do understan=
d
> the problem-space much better than I do. Would I have understood, I
> probably would had sent a bug fix
> >>
> >> Theo
> >>
> >> PS. It is part of the "Act-out-of-the-Box" install script, and it just
> looks ugly to do a force install, but it will do the job for now
> >
>
--001a1140f6eaeaeb8805570a6f33
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><span style=3D"font-family:aria=
l,helvetica,sans-serif;color:rgb(0,0,0);white-space:pre-wrap">(forwarding t=
o DateTime list because this looks interesting)</span></div><div class=3D"g=
mail_quote"><font color=3D"#000000" face=3D"arial, helvetica, sans-serif"><=
span style=3D"white-space:pre-wrap"><br></span></font><div dir=3D"ltr">I=
9;ve created this test - <a href=3D"https://gist.github.com/fglock/cf1117ad=
000b41d9e5dbee6fa8b78993" target=3D"_blank">https://gist.github.com/<wbr>fg=
lock/<wbr>cf1117ad000b41d9e5dbee6fa8b789<wbr>93</a><br><br>this fails (set =
time zone implicitly through dtstart):<br><br><font face=3D"monospace, mono=
space">=C2=A0 =C2=A0 $a =3D DateTime::Event::ICal->recur(<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dtstart =3D> $dt19970902T090000_tz ,<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 freq =3D> 'daily',<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 count =3D> 10 )<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ->intersection( $period_1995_1999 );</fo=
nt><div><br></div><div>this other test works (time zone is set explicitly f=
or the whole recurrence):</div><div><br></div><div><div><font face=3D"monos=
pace, monospace">=C2=A0 =C2=A0 $a =3D DateTime::Event::ICal->recur(</fon=
t></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 dtstart =3D> $dt19970902T090000_tz ,</font></div><div>=
<font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 freq =3D> 'daily',</font></div><div><font face=3D"monospace,=
monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 count =3D> 10 )</f=
ont></div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ->set_time_zone( "America/New_York" )</font>=
</div><div><font face=3D"monospace, monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ->intersection( $period_1995_1999 );</font></div></div><di=
v><br></div><div>I believe this is the correct behaviour (though it should =
warn!), because=C2=A0</div><div><a href=3D"http://www.ietf.org/rfc/rfc2445.=
txt" target=3D"_blank">http://www.ietf.org/rfc/<wbr>rfc2445.txt</a><br></di=
v><div>says:</div><div><br></div><div><quote></div><div><pre style=3D=
"word-wrap:break-word">Dawson & Stenerson =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0Standards Track =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 [Page 117]<br>=0C<br>RFC 2445 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iCalendar =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 November 1998<br><br><br>=C2=A0 =
=C2=A0The "DTSTART" and "DTEND" property pair or "=
DTSTART" and "DURATION"<br>=C2=A0 =C2=A0property pair, speci=
fied within the iCalendar object defines the<br>=C2=A0 =C2=A0first instance=
of the recurrence. When used with a recurrence rule,<br>=C2=A0 =C2=A0the &=
quot;DTSTART" and "DTEND" properties MUST be specified in lo=
cal time<br>=C2=A0 =C2=A0and the appropriate set of "VTIMEZONE" c=
alendar components MUST be<br>=C2=A0 =C2=A0included. For detail on the usag=
e of the "VTIMEZONE" calendar<br>=C2=A0 =C2=A0component, see the =
"VTIMEZONE" calendar component definition.<font color=3D"#000000"=
><span style=3D"white-space:pre-wrap"></quote></span></font></pre><pr=
e style=3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><fon=
t face=3D"arial, helvetica, sans-serif">I *think* DateTime::Event::ICal is =
doing the right thing, but the module documentation is not clear:</font></p=
re><pre style=3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap=
"><font face=3D"arial, helvetica, sans-serif"><quote></font></pre><pr=
e style=3D"word-wrap:break-word"><font color=3D"#000000"><span style=3D"whi=
te-space:pre-wrap"><font face=3D"monospace, monospace">This method takes pa=
rameters which correspond to the rule parts
specified in section 4.3.10 of RFC 2445. Rather than rewrite that RFC
here, you are encouraged to read that first if you want to understand
what all these parameters represent.</font><font face=3D"arial, helvetica, =
sans-serif">
</font></span></font></pre><div><font face=3D"arial, helvetica, sans-serif"=
></quote></font></div><pre style=3D"color:rgb(0,0,0);word-wrap:break-=
word;white-space:pre-wrap"><font face=3D"arial, helvetica, sans-serif">It *=
could* as well also use the time_zone from "dtstart".</font></pre=
><pre style=3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">=
<font face=3D"arial, helvetica, sans-serif">Simon: do you think this explai=
ns the problem, and can this can be fixed in your module maybe?</font></pre=
><pre style=3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">=
<font face=3D"arial, helvetica, sans-serif">Fl=C3=A1vio S. Glock</font><br>=
</pre><pre style=3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-w=
rap"><font face=3D"arial, helvetica, sans-serif"><br></font></pre></div></d=
iv><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><br><=
div class=3D"gmail_quote">2017-08-18 18:28 GMT+02:00 Flavio S. Glock <span =
dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">fgloc=
[email protected]</a>></span>:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">just to confi=
rm, I did a fresh install and I get:<br>
<br>
t/01.parse_recurring.t ...... 1/18<br>
#=C2=A0 =C2=A0Failed test at t/01.parse_recurring.t line 25.<br>
#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 got: 'floating'<br>
#=C2=A0 =C2=A0 =C2=A0expected: 'Europe/London'<br>
<br>
I'm investigating a bit<br>
<br>
Fl=C3=A1vio<br>
<div class=3D"m_-2462350057489538370HOEnZb"><div class=3D"m_-24623500574895=
38370h5"><br>
<br>
2017-08-18 17:33 GMT+02:00 Th.J. van Hoesel <<a href=3D"mailto:slrn40626=
[email protected]" target=3D"_blank">[email protected]</a>>:<br>
> just fiddling along, it works if I first install FGLOCK/DateTime-Event=
-Recurren<wbr>ce-0.16<br>
><br>
>> On 18 Aug 2017, at 15:34, Th.J. van Hoesel <<a href=3D"mailto:t=
[email protected]" target=3D"_blank">[email protected]</a>> wrote:<=
br>
>><br>
>> Hi Fl=C3=A1vio, Hello Simon,<br>
>><br>
>> i've some issues with installing Data::Ical::DateTime and I ca=
n not exactly say who is in the right or who is in the wrong, that would re=
quire more investigation.<br>
>><br>
>> Data::Ical::DateTime is depending on DateTime::Event::Recurrence, =
with is dependent on DateTime::Set. When that was changed back in november =
2015, that is when Data::ICal::DateTime started failing on CPAN testers.<br=
>
>><br>
>> Maybe one does a wrong call and should actually had expected to ge=
t "floating" timezones, maybe one does expected that his timezone=
from the .ics test file would be honoured.<br>
>><br>
>> Could you please be so kind and have a look, you probably do under=
stand the problem-space much better than I do. Would I have understood, I p=
robably would had sent a bug fix<br>
>><br>
>> Theo<br>
>><br>
>> PS. It is part of the "Act-out-of-the-Box" install scrip=
t, and it just looks ugly to do a force install, but it will do the job for=
now<br>
><br>
</div></div></blockquote></div><br></div>
</div></div></div><br></div>
--001a1140f6eaeaeb8805570a6f33--