Changeset 17947 in spip-zone for _contribs_/_filtres_/duree


Ignore:
Timestamp:
Jan 10, 2008, 11:12:58 AM (11 years ago)
Author:
erational@…
Message:

correction de la valeur année (oups)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _contribs_/_filtres_/duree/inc_duree.php

    r17912 r17947  
    44 *    Nom du Filtre : duree   
    55 *   +----------------------------------+
    6  *    date : 2008.01.07
     6 *    date : 2008.01.10
    77 *    auteur :  erational - http://www.erational.org
    8  *    version: 0.24
     8 *    version: 0.25
    99 *    licence: GPL
    1010 *   +-------------------------------------+
     
    4646              substr($date_fin,8,2),
    4747              substr($date_fin,0,4));
    48             
    49   $diff_seconds  = $d_fin - $d_debut;
     48     
     49  $diff_seconds  = $d_fin - $d_debut; 
    5050  if ($diff_seconds<0) return "";
    51   $diff_years    = floor($diff_seconds/31449600);
    52   $diff_seconds -= $diff_years   * 31449600; 
     51  $diff_years    = floor($diff_seconds/31536000);
     52  $diff_seconds -= $diff_years   * 31536000; 
    5353  $diff_weeks    = floor($diff_seconds/604800);
    5454  $diff_seconds -= $diff_weeks   * 604800;
     
    5858  $diff_seconds -= $diff_hours   * 3600;
    5959  $diff_minutes  = floor($diff_seconds/60);
    60   $diff_seconds -= $diff_minutes * 60;
    61  
    62   $str = ""; 
    63  
     60  $diff_seconds -= $diff_minutes * 60; 
     61  $str = "";
    6462  switch ($type_affichage) {
    65       case "court" :    if ($diff_years>1) $str = "$diff_weeks ans";
    66                         else if ($diff_years>0) $str = "$diff_weeks an";
     63      case "court" :    if ($diff_years>1) $str = "$diff_years ans";
     64                        else if ($diff_years>0) $str = "$diff_years an";
    6765                        else if ($diff_weeks>1) $str = "$diff_weeks semaines";
    6866                        else if ($diff_weeks>0) $str = "$diff_weeks semaine";
     
    124122        return $str;
    125123}
    126 
    127124?>
Note: See TracChangeset for help on using the changeset viewer.