X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-from_to.html;h=100381234184730631f30cc0990e5d7ef8db857b;hp=083243d403ef6ea01e3383901c85933410481151;hb=c3da5cf1caa244937d280e0f406927103beef148;hpb=624b2d44625f69d71175c3348cae635d580c890b diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html index 083243d40..100381234 100644 --- a/httemplate/elements/tr-select-from_to.html +++ b/httemplate/elements/tr-select-from_to.html @@ -1,52 +1,45 @@ -% -% -% #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -% my ($curmon,$curyear) = (localtime(time))[4,5]; -% -% #find first month -% my $syear = 1899+$curyear; -% my $smonth = $curmon+1; -% -% #want 12 month by default, not 13 -% $smonth++; -% if ( $smonth > 12 ) { $smonth-=12; $syear++ } -% -% #find last month -% my $eyear = 1900+$curyear; -% my $emonth = $curmon+1; -% -% my %hash = ( -% 'show_month_abbr' => 1, -% 'start_year' => '1999', -% 'end_year' => '2012', #haha, well... -% @_, -% ); -% -% - - - From: + <% mt('From: ') |h %> - <% include('/elements/select-month_year.html', + <& /elements/select-month_year.html, 'prefix' => 'start', 'selected_mon' => $smonth, 'selected_year' => $syear, %hash, - ) - %> + &> - To: + <% mt('To: ') |h %> - <% include('/elements/select-month_year.html', + <& /elements/select-month_year.html, 'prefix' => 'end', 'selected_mon' => $emonth, 'selected_year' => $eyear, %hash, - ) - %> + &> +<%init> + my ($curmon,$curyear) = (localtime(time))[4,5]; + + #find first month + my $syear = 1899+$curyear; + my $smonth = $curmon+1; + + #want 12 month by default, not 13 + $smonth++; + if ( $smonth > 12 ) { $smonth-=12; $syear++ } + + #find last month + my $eyear = 1900+$curyear; + my $emonth = $curmon+1; + + my %hash = ( + 'show_month_abbr' => 1, + 'start_year' => '1999', + 'end_year' => '2012', #haha, well... + @_, + ); +