Skip Menu |

This queue is for tickets about the DateTime-Event-Sunrise CPAN distribution.

Report information
The Basics
Id: 8065
Status: resolved
Priority: 0/
Queue: DateTime-Event-Sunrise

People
Owner: rkhill [...] cpan.org
Requestors: rkhill [...] cpan.org
Cc: jhoblitt [...] ifa.hawaii.edu;sisk@mojotoad.com
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 0.0503



CC: jhoblitt [...] ifa.hawaii.edu;sisk [...] mojotoad.com
I need the ability to correct the altitude angle for height above sea level. The validation regex for this value currently doesn't allow arbitrary floating point values. Could you change it to something like the patch below? diff -u -r1.22 Sunrise.pm --- lib/DateTime/Event/Sunrise.pm 9 Jun 2004 20:05:06 -0000 1.22 +++ lib/DateTime/Event/Sunrise.pm 19 Oct 2004 21:50:56 -0000 @@ -28,7 +28,7 @@ altitude => { type => SCALAR, default => '-0.833', - regex => qr/^(0|-0.25|-0.583|-0.833|-6|-12|-15|-18)$/ + regex => qr/^(0|-\d+)$/ }, iteration => { type => SCALAR, default => '0' }, }
Le Mer 20 Oct 2004 17:14:59, RKHILL a écrit : Show quoted text
> I need the ability to correct the altitude angle for height above sea > level. The validation regex for this value currently doesn't allow > arbitrary floating point values. Could you change it to something like > the patch below? > > diff -u -r1.22 Sunrise.pm > --- lib/DateTime/Event/Sunrise.pm 9 Jun 2004 20:05:06 -0000 1.22 > +++ lib/DateTime/Event/Sunrise.pm 19 Oct 2004 21:50:56 -0000 > @@ -28,7 +28,7 @@ > altitude => { > type => SCALAR, > default => '-0.833', > - regex => qr/^(0|-0.25|-0.583|-0.833|-6|-12|-15|-18)$/ > + regex => qr/^(0|-\d+)$/ > }, > iteration => { type => SCALAR, default => '0' }, > } >
Fixed in the 0.0503 version. I have not used your regexp. I have even not tested it, I have just read it. I have used another regexp, which allows values with a decimal part (yours does not allow them) and positive values, in case you would want to know when the sun is masked by a mountain range, a high forest or a high and broad building.