Fix format not supported by js lib

This commit is contained in:
Laurent Destailleur 2015-04-17 13:22:36 +02:00
parent bf254baa02
commit 78e6aacda2
2 changed files with 6 additions and 5 deletions

View File

@ -90,7 +90,7 @@ if (g)
var barText = "Resource";
var graphFormat = "day";
g.setDateInputFormat('yyyy-mm-dd'); // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', 'yyyy-mm-dd')
g.setDateInputFormat('mm/dd/yyyy'); // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', does not work with 'yyyy-mm-dd')
g.setDateDisplayFormat('<?php echo $dateformat; ?>');
/* For JSGanttImproved g.setDateTaskDisplayFormat('<?php echo $datehourformat; ?>'); */
/* For JSGanttImproved g.setDayMajorDateDisplayFormat('dd mon'); */
@ -143,8 +143,8 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
$start_date = $task["task_start_date"];
$end_date = $task["task_end_date"];
if (!$end_date) $end_date = $start_date;
$start_date = dol_print_date($start_date,"%Y-%m-%d");
$end_date = dol_print_date($end_date,"%Y-%m-%d");
$start_date = dol_print_date($start_date,"%m/%d/%Y");
$end_date = dol_print_date($end_date,"%m/%d/%Y");
// Resources
$resources = $task["task_resources"];
// Define depend (ex: "", "4,13", ...)

View File

@ -150,8 +150,9 @@ if ($id > 0 || ! empty($ref))
/*
* Actions
* Buttons actions
*/
print '<div class="tabsAction">';
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
@ -205,6 +206,7 @@ if (count($tasksarray)>0)
$tasks[$taskcursor]['task_milestone']=0;
$tasks[$taskcursor]['task_percent_complete']=$val->progress;
//$tasks[$taskcursor]['task_name']=$task->getNomUrl(1);
//print dol_print_date($val->date_start).dol_print_date($val->date_end).'<br>'."\n";
$tasks[$taskcursor]['task_name']=$val->label;
$tasks[$taskcursor]['task_start_date']=$val->date_start;
$tasks[$taskcursor]['task_end_date']=$val->date_end;
@ -243,7 +245,6 @@ if (count($tasksarray)>0)
//print "xxx".$val->id.$tasks[$taskcursor]['task_resources'];
$taskcursor++;
}
//var_dump($tasks);
print "\n";