1 % unless ( $m->count == $previous_request_count ) {
2 <LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2">
3 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT>
4 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT>
5 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT>
9 <TD ALIGN="right">From date: </TD>
10 <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>beginning" ID="<% $opt{prefix} %>beginning_text" VALUE="<% $from ? time2str($date_format, $from) : '' %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>beginning_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>beginning_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD>
11 <SCRIPT TYPE="text/javascript">
13 inputField: "<% $opt{prefix} %>beginning_text",
14 ifFormat: "<% $date_format. $time_format %>",
15 button: "<% $opt{prefix} %>beginning_button",
21 % unless ( $opt{layout} =~ /^h/i ) { #horizontal
28 <TD ALIGN="right">To date: </TD>
29 <TD><INPUT TYPE="text" NAME="<% $opt{prefix} %>ending" ID="<% $opt{prefix} %>ending_text" VALUE="<% $to ? time2str($date_format, $to) : '' %>" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="<%$fsurl%>images/calendar.png" ID="<% $opt{prefix} %>ending_button" STYLE="cursor: pointer" TITLE="Select date"><IMG SRC="<%$fsurl%>images/calendar-disabled.png" ID="<% $opt{prefix} %>ending_disabled" STYLE="display:none"><BR><i>m/d/y<% $time_hint %></i></TD>
30 <SCRIPT TYPE="text/javascript">
32 inputField: "<% $opt{prefix} %>ending_text",
33 ifFormat: "<% $date_format. $time_format %>",
34 button: "<% $opt{prefix} %>ending_button",
41 % unless ( $datesrequired ) {
44 <TD COLSPAN=<% $opt{layout} =~ /^h/i ? 3 : 1 %>>
45 <FONT SIZE="-1">(leave one or both dates blank for an open-ended search)</FONT>
52 my $previous_request_count = '';
59 my $conf = new FS::Conf;
61 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
62 my $datesrequired = 0;
63 $datesrequired = $opt{'datesrequired'} if $opt{'datesrequired'};
66 $from = $opt{'from'} if $opt{'from'};
68 $to = $opt{'to'} if $opt{'to'};
70 $opt{prefix} = '' unless defined $opt{prefix};
71 $opt{prefix} .= '_' if $opt{prefix};
73 my( $input_time, $time_format, $time_hint ) = ( '', '', '' );
74 my( $size, $maxlength ) = ( 11, 10 );
75 if ( $opt{'input_time'} ) {
76 $input_time = ', showsTime: true, timeFormat: "12"'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3
77 $time_format = ' %H:%M:%S'; # http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_5.3.5
78 $time_hint = ' h:m:s';
86 $previous_request_count = $m->count;