1 <%doc>-------------------------------------------------------------------
2 monthMenu: Display a pulldown menu of months
5 $menu_name - Name of menu, defaults to 'month'
6 $current - Selected month value (1 to 12)
7 $format - Choice of month labels:
8 'full' (January, February, ...)
9 'short' (Jan, Feb, ...)
11 Defaults to 'full'. The format only affects appearance; the menu
12 values are always numeric.
13 -------------------------------------------------------------------</%doc>
15 <select name="<% $menu_name %>">
17 % foreach my $month (1..12) {
18 <option value="<% $month %>" <% $month==$current ? "selected" : "" %>>
19 % if ($format eq 'full') {
20 <% $month_names[$month-1] %>
21 % } elsif ($format eq 'short') {
22 <% substr($month_names[$month-1],0,3) %>
23 % } elsif ($format eq 'numeric') {
24 <% sprintf("%02d",$month) %>
30 my @month_names = qw(January February March April May June July August September October November December);