Fix date into new gantt chart

This commit is contained in:
Laurent Destailleur 2016-07-26 14:41:15 +02:00
parent 03cb5c66b8
commit 14cb6d73bc
2 changed files with 12 additions and 6 deletions

View File

@ -90,9 +90,9 @@ if (g.getDivId() != null)
var barText = "Resource";
var graphFormat = "day";
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; ?>');
g.setDateTaskDisplayFormat('<?php echo $datehourformat; ?>');
g.setDateInputFormat('<?php echo $dateformatinput; ?>'); // Set format of input dates ('mm/dd/yyyy', 'dd/mm/yyyy', does not work with 'yyyy-mm-dd')
g.setDateTaskTableDisplayFormat('<?php echo $datehourformat; ?>'); // Format of date used into line
g.setDateTaskDisplayFormat('<?php echo $datehourformat; ?>'); // Format of date used into popup, not into line
g.setDayMajorDateDisplayFormat('dd mon');
g.setShowRes(1); // Show/Hide Responsible (0/1)
g.setShowDur(1); // Show/Hide Duration (0/1)
@ -140,11 +140,13 @@ else
*/
function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_id=null)
{
global $dateformatinput2;
$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,"%m/%d/%Y");
$end_date = dol_print_date($end_date,"%m/%d/%Y");
$start_date = dol_print_date($start_date, $dateformatinput2);
$end_date = dol_print_date($end_date, $dateformatinput2);
// Resources
$resources = $task["task_resources"];
// Define depend (ex: "", "4,13", ...)

View File

@ -268,7 +268,11 @@ if (count($tasksarray)>0)
if (! empty($conf->use_javascript_ajax))
{
//var_dump($_SESSION);
print '<div id="tabs" class="gantt" style="width: 80vw;border: 1px solid #ACACAC;">'."\n";
$dateformatinput='mm/dd/yyyy'; // How the date for data are formated
$dateformatinput2="%m/%d/%Y"; // How the date for data are formated
//var_dump($dateformatinput);
//var_dump($dateformatinput2);
print '<div id="tabs" class="gantt" style="border: 1px solid #ACACAC;">'."\n";
include_once DOL_DOCUMENT_ROOT.'/projet/ganttchart.inc.php';
print '</div>'."\n";
}