[ic] Date widget reserves years when not wanted

Bill Carr bill at bottlenose-wine.com
Thu Apr 15 15:50:50 UTC 2010


On Apr 15, 2010, at 11:38 AM, David Christensen wrote:

> 
> On Apr 15, 2010, at 10:23 AM, Bill Carr wrote:
> 
>> Vend::Form.pm Line 536:
>> 		@Years = $by <= $ey ? ($by .. $ey) : reverse ($ey .. $by);
>> 
>> Could we change to:
>> 	@Years = $by .. $ey;
> 
> 
> The .. operator does not work unless the first operand is smaller than the second; i.e., it only increases.  If you want something like that, you'd need to reverse the results of @Years, not the order of the operands.
> 
> $ perl -le 'print $_ for 1..5'                                                                                                                                 
> 1                                                                                                                                                                               
> 2
> 3
> 4
> 5
> 
> $ perl -le 'print $_ for 5..1'                                                                                                                                 
> $
Ok, Howabout

@Years = $by <= $ey ? ($by .. $ey) : reverse ($ey .. $by);
@Years = reverse @Years  if $opt->{year_order} =~ /desc/i;

 
Bill Carr 
Bottlenose - Wine & Spirits eBusiness Specialists 
(413) 584-0400 
http://www.bottlenose-wine.com 
 Download vCard




More information about the interchange-users mailing list