egroupware/phpgwapi/js/dhtmlxGantt/samples/03_scales/09_skip_weekends.html

47 lines
1.4 KiB
HTML
Executable File

<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Not render weekends on the scale</title>
</head>
<script src="../../codebase/dhtmlxgantt.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>
<body>
<style type="text/css">
html, body{ padding:0px; margin:0px; height:100%; }
</style>
<div id="gantt_here" style='width:100%; height:100%;'></div>
<script type="text/javascript">
gantt.config.xml_date = "%Y-%m-%d %H:%i:%s";
gantt.config.scale_unit = "month";
gantt.config.step = 1;
gantt.config.date_scale = "%F, %Y";
gantt.config.min_column_width = 50;
gantt.config.scale_height = 90;
var weekScaleTemplate = function(date){
var dateToStr = gantt.date.date_to_str("%d %M");
var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
return dateToStr(date) + " - " + dateToStr(endDate);
};
gantt.config.subscales = [
{unit:"week", step:1, template:weekScaleTemplate},
{unit:"day", step:1, date:"%D" }
];
gantt.ignore_time = function(date){
if(date.getDay() == 0 || date.getDay() == 6)
return true;
return false;
};
gantt.init("gantt_here");
gantt.load("../common/data.json", "json");
</script>
</body>