Fix pb into date management.

Added phpunit to avoid this in future.
This commit is contained in:
Laurent Destailleur
2015-02-03 11:25:51 +01:00
parent 75f451ccc7
commit 20121c2fbe
6 changed files with 92 additions and 25 deletions

View File

@@ -999,8 +999,9 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
/**
* Return an array with locale date info.
* PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
* WARNING: This function always use PHP server timezone to return locale informations.
* WARNING: This function always use PHP server timezone to return locale informations !!!
* Usage must be avoid.
* FIXME: Replace this with PHP date function and a parameter $gm
*
* @param int $timestamp Timestamp
* @param boolean $fast Fast mode
@@ -1010,7 +1011,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
* 'minutes' => $min,
* 'hours' => $hour,
* 'mday' => $day,
* 'wday' => $dow,
* 'wday' => $dow, 0=sunday, 6=saturday
* 'mon' => $month,
* 'year' => $year,
* 'yday' => floor($secsInYear/$_day_power),
@@ -1044,7 +1045,7 @@ function dol_getdate($timestamp,$fast=false)
{
$arrayinfo=getdate($timestamp);
$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
/*$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
if($startday==1)
{
if ($arrayinfo["wday"]==0)
@@ -1055,7 +1056,7 @@ function dol_getdate($timestamp,$fast=false)
{
$arrayinfo["wday"]=$arrayinfo["wday"]-1;
}
}
}*/
}
return $arrayinfo;