2
0
forked from Wavyzz/dolibarr

Fix: datepicker first day of week can be monday by setting into

display setup
This commit is contained in:
Juanjo Menent
2014-12-06 11:00:49 +01:00
parent 6720d3d706
commit fe23a851e7
3 changed files with 32 additions and 0 deletions

View File

@@ -1028,6 +1028,8 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
*/
function dol_getdate($timestamp,$fast=false)
{
global $conf;
$usealternatemethod=false;
if ($timestamp <= 0) $usealternatemethod=true; // <= 1970
if ($timestamp >= 2145913200) $usealternatemethod=true; // >= 2038
@@ -1039,6 +1041,19 @@ function dol_getdate($timestamp,$fast=false)
else
{
$arrayinfo=getdate($timestamp);
$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
if($startday==1)
{
if ($arrayinfo["wday"]==0)
{
$arrayinfo["wday"]=6;
}
else
{
$arrayinfo["wday"]=$arrayinfo["wday"]-1;
}
}
}
return $arrayinfo;