installers (calendaring), RT#16584
[freeside.git] / httemplate / elements / select-time.html
index 6e22e1e..e7b404b 100644 (file)
@@ -6,7 +6,7 @@
                    || $curr_value == $t
                      ? 'SELECTED' : ''
                 %>
-        ><% pretty_time($t) %>
+        ><% FS::sched_avail::pretty_time($t) %>
 %     }
     </SELECT>
 % }
@@ -28,22 +28,4 @@ if ( $opt{'onchange'} ) {
   $onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
 }
 
-sub pretty_time {
-  my $t = shift;
-
-  return 'Midnight' if $t == 0 || $t == 1440;
-  return 'Noon'     if $t == 720;
-
-  my $h = int( $t / 60 );
-  my $m = $t % 60;
-
-  my $ap = 'AM';
-  if    ( $h == 0 || $h == 24 ) { $h = 12; }
-  elsif ( $h == 12 )           { $ap = 'PM'; }
-  elsif ( $h > 12 )            { $ap = 'PM'; $h -= 12; }
-
-  sprintf('%02d:%02d'." $ap", $h, $m);
-
-}
-
 </%init>