Ignore:
Timestamp:
04/16/07 16:28:06 (16 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/image.php:

web/addons/job_monarch/overview.php:

  • removed function makeTime -> moved to libtoga.php

web/addons/job_monarch/libtoga.php:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/overview.php

    r302 r303  
    9494}
    9595
    96 function makeTime( $time ) {
    97 
    98         $days = intval( $time / 86400 );
    99         $time = ($days>0) ? $time % ($days * 86400) : $time;
    100 
    101         //printf( "time = %s, days = %s\n", $time, $days );
    102 
    103         $date_str = '';
    104         $day_str = '';
    105 
    106         if( $days > 0 ) {
    107                 if( $days > 1 )
    108                         $day_str .= $days . ' days';
    109                 else
    110                         $day_str .= $days . ' day';
    111         }
    112 
    113         $hours = intval( $time / 3600 );
    114         $time = $hours ? $time % ($hours * 3600) : $time;
    115 
    116         //printf( "time = %s, days = %s, hours = %s\n", $time, $days, $hours );
    117 
    118         if( $hours > 0 ) {
    119                 $date_str .= $hours . ':';
    120                 $date_unit = 'hours';
    121         }
    122                
    123         $minutes = intval( $time / 60 );
    124         $seconds = $minutes ? $time % ($minutes * 60) : $time;
    125 
    126         if( $minutes > 0 ) {
    127 
    128                 if( $minutes >= 10 )
    129                         $date_str .= $minutes . ':';
    130                 else
    131                         $date_str .= '0' . $minutes . ':';
    132 
    133                 $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit;
    134         } else {
    135                 if($hours > 0 ) {
    136                         $date_str .= '00:';
    137                         $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit;
    138                 }
    139         }
    140 
    141 
    142         $date_unit = (!isset($date_unit)) ? 'seconds' : $date_unit;
    143 
    144         if( $seconds > 0 ) {
    145 
    146                 if( $seconds >= 10 )
    147                         $date_str .= $seconds . ' ' . $date_unit;
    148                 else
    149                         $date_str .= '0' . $seconds . ' ' . $date_unit;
    150                        
    151         } else if ( $hours > 0 or $minutes > 0 )
    152 
    153                 $date_str .= '00 ' . $date_unit;
    154 
    155         if( $days > 0) {
    156 
    157                 if( $hours > 0 or $minutes > 0 or $seconds > 0 )
    158                         $date_str = $day_str . ' - ' . $date_str;
    159                 else
    160                         $date_str = $day_str;
    161         }
    162 
    163         return $date_str;
    164 }
    165 
    16696//function makeDate( $time ) {
    16797//      return strftime( "%a %d %b %Y %H:%M:%S", $time );
Note: See TracChangeset for help on using the changeset viewer.