Skip Menu |

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

Report information
The Basics
Id: 4785
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: DateTime-Event-Sunrise

People
Owner: rkhill [...] cpan.org
Requestors: daisuke [...] cpan.org
Cc:
AdminCc:

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



Subject: RFC: Expose simple API to compute sunrise and sunset times for a given date
Most of the times I don't ever use recurrences to compute sunrise and sunset times -- instead, just one day's worth of sunrise and sunset time is usually all I need. It would be nice if there was a way to directly compute this. Looking at the source, it almost looks like sunrise_sunset() does what I need, a) it's not documented, and b) it looks like it's just a helper routine. Cleaning it up some to allow an interface along the lines of my $sunrise = DateTime::Event::Sunrise->new(...); my($rise_dt, $set_dt) = $sunrise->sunrise_sunset($dt); Or my($rise_dt, $set_dt) = DateTime::Event::Sunrise->new( longitude => $lo, latitude => $la, altitude => $a, iteration => $i datetime => $dt ); would be very nice.
RT-Send-CC: datetime [...] perl.org
[guest - Tue Dec 30 01:49:17 2003]: Show quoted text
> Most of the times I don't ever use recurrences to compute sunrise > and sunset times -- instead, just one day's worth of sunrise and > sunset time is usually all I need. It would be nice if there was > a way to directly compute this. > > Looking at the source, it almost looks like sunrise_sunset() does > what I need, a) it's not documented, and b) it looks like it's > just a helper routine. > > Cleaning it up some to allow an interface along the lines of > > my $sunrise = DateTime::Event::Sunrise->new(...); > my($rise_dt, $set_dt) = $sunrise->sunrise_sunset($dt); > > Or > > my($rise_dt, $set_dt) = DateTime::Event::Sunrise->new( > longitude => $lo, > latitude => $la, > altitude => $a, > iteration => $i > datetime => $dt > ); > > would be very nice.
Hello, I will bring this up on the datetime mailing list and see what they say :) Thanks for using DateTime !! Ron Hill
Added in release 0.05 of the module. - Added sunrise_sunset_span method. This will return rise/set time for one day (as a span object). Request # 4785 on rt.cpan.org Added sunrise_datetime, sunset_datetime method.