2016-10-14 3 views
1

私はGantt Docsdhtmlx Ganttで日付形式を変更するには?

まあからダウンロードガントテンプレートを持って、私は私のガントと呼ばれるが、私は年2015年から2023年までの時間帯を設定する代わりに、それは日/ヶ月にデフォルト設定させるのが、私ドン私がどこでそれを変えることができるかわかりません。

gantt.config.duration_unit = "year"; 

デフォルト値: "日" 年の期間単位の設定の値を設定し

<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
<title>Tooltip</title> 
</head> 
<script src="../../codebase/dhtmlxgantt.js" type="text/javascript" charset="utf-8"></script> 
<script src="../../codebase/ext/dhtmlxgantt_tooltip.js" type="text/javascript" charset="utf-8"></script> 
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css" type="text/css" media="screen" title="no title" charset="utf-8"> 

<script type="text/javascript" src="../common/testdata.js"></script> 
<style type="text/css"> 
    html, body{ height:100%; padding:0px; margin:0px; overflow: hidden;} 
</style> 
<body> 
<div id="gantt_here" style='width:100%; height:100%;'></div> 

<script type="text/javascript"> 

    var tasks = { 
     data:[ 
      {id:1, text:"Project #2", start_date:"01-04-2013", duration:18,order:10, 
       progress:0.4, open: true}, 
      {id:2, text:"Task #1", start_date:"02-04-2013", duration:8, order:10, 
       progress:0.6, parent:1}, 
      {id:3, text:"Task #2", start_date:"11-04-2013", duration:8, order:20, 
       progress:0.6, parent:1} 
     ], 
     links:[ 
      { id:1, source:1, target:2, type:"1"}, 
      { id:2, source:2, target:3, type:"0"}, 
      { id:3, source:3, target:4, type:"0"}, 
      { id:4, source:2, target:5, type:"2"}, 
     ] 
    }; 

    gantt.init("gantt_here"); 
    gantt.parse(tasks); 

    gantt.init("gantt_here"); 
    gantt.parse(demo_tasks); 
</script> 
</body> 
</html> 

答えて

2

ちょうど

<script type="text/javascript"> 
gantt.config.scale_unit = "year"; 
gantt.config.step = 1; 
gantt.config.date_scale = "%Y"; 
gantt.config.min_column_width = 30; 
gantt.config.scale_height = 80; 

var tasks = { 
    data:[ 
     {id:1, text:"Project #2", start_date:"01-04-2013", duration:18,order:10, 
      progress:0.4, open: true}, 
     {id:2, text:"Task #1", start_date:"02-04-2013", duration:8, order:10, 
      progress:0.6, parent:1}, 
     {id:3, text:"Task #2", start_date:"11-04-2013", duration:8, order:20, 
      progress:0.6, parent:1} 
    ], 
    links:[ 
     { id:1, source:1, target:2, type:"1"}, 
     { id:2, source:2, target:3, type:"0"}, 
     { id:3, source:3, target:4, type:"0"}, 
     { id:4, source:2, target:5, type:"2"}, 
    ] 
}; 

gantt.init("gantt_here"); 
gantt.parse(tasks); 

</script> 
+0

良い仕事をし、それを呼び出す前に、私のガントの設定を変更しました!がんばり続ける.. – zamebit

3

。解決策が見つかりました

関連する問題