If the RD is a value that only changes at midnight (as you noted previously), then I think my order is right. The way you're suggesting would change the RD if it's after sunset - wouldn't it? If you took a DT::Calendar::Hebrew with an incremented RD and converted it to a DateTime, then converted that DateTime to another DT::Calendar::Hebrew, wouldn't you keep jumping ahead a day, b/c each time you'd increment RD b/c it's after sunset on the day in question?
Steve
Flavio S. Glock wrote:
Steven:
I think these 2 program segments in 'set' method should be in inverted order:
$self->{rd_days} = &_to_rd( ... $self->{rd_secs} = ... $self->{rd_nanosecs} = $self->{nanosecond};
if($self->{sunset} and $self->{time_zone}) { my $DT_Event_Sunrise = $self->{sunset}; ... if($sunset > $DT) { $self->{after_sunset} = 1; @{$self}{qw/year month day/} = &_from_rd($self->{rd_days} + 1); }
Because you will end up with a different day from what was asked.
Instead, you should set the day, and then set RD accordingly.
- Flavio S. Glock