Changeset 2578


Ignore:
Timestamp:
Jan 7, 2012, 6:44:22 PM (8 years ago)
Author:
komodo
Message:

last time new year's fix for graphs NS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/branches/senat/project/apps/frontend/modules/plot/actions/components.class.php

    r2559 r2578  
    2121      $annee0 = date('Y', $last_year); $sem0 = date('W', $last_year);
    2222      if ($sem >= 52 && date('n', $date) == 1) $sem = 0;
     23      if ($sem0 >= 52 && $sem <= 1) $sem0 = 0;
    2324      $n_weeks = ($annee - $annee0)*53 + $sem - $sem0 + 1;
    2425//print "$date ; $annee ; $sem ; $last_year ; $annee0 ; $sem0 ; $date_debut ; $n_weeks";
     
    161162
    162163 public static function getLabelsSemaines($n_weeks, $annee, $sem) {
    163     if ($sem <= 51) $an = $annee + 1;
     164    if ($sem != 0 && $sem <= 51) $an = $annee + 1;
    164165    else $an = $annee;
    165166    $hashmap = array( '3'  => "Jan ".sprintf('%02d', $an-2000), '6'  => " Fév", '10' => " Mar", '15' => "Avr",
Note: See TracChangeset for help on using the changeset viewer.