Skip to content

Commit 075f3dc

Browse files
author
Marek Bielańczuk
committed
Fix for mbielanczuk#7 : Weeks numbers
1 parent 5ff1081 commit 075f3dc

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

index.htm

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
66
<meta content="Marek Bielanczuk" name="Author" />
77
<script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
8-
<script src="js/jquery.fn.gantt.js" type="text/javascript"></script>
8+
<script src="js/jquery.fn.gantt.min.js" type="text/javascript"></script>
99
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
1010
<script type="text/javascript">
1111
<!--
1212
jQuery(function () {
1313
var dataPath = location.href.substring(0, location.href.lastIndexOf('/')+1);
14-
$(".gantt").gantt({source: dataPath + "js/dataHours.js", navigate: 'scroll', scale: 'hours', maxScale: 'hours', minScale: 'hours', hollydays: ["\/Date(1293836400000)\/","\/Date(1294268400000)\/","\/Date(1303596000000)\/","\/Date(1306274400000)\/","\/Date(1304200800000)\/","\/Date(1304373600000)\/","\/Date(1307829600000)\/","\/Date(1308780000000)\/","\/Date(1313359200000)\/","\/Date(1320105600000)\/","\/Date(1320966000000)\/","\/Date(1324767600000)\/","\/Date(1324854000000)\/","\/Date(1325372400000)\/","\/Date(1325804400000)\/","\/Date(1333836000000)\/","\/Date(1336514400000)\/","\/Date(1335823200000)\/","\/Date(1335996000000)\/","\/Date(1338069600000)\/","\/Date(1339020000000)\/","\/Date(1344981600000)\/","\/Date(1351724400000)\/","\/Date(1352588400000)\/","\/Date(1356390000000)\/","\/Date(1356476400000)\/"]});
15-
//$(".gantt2").gantt({source: dataPath + "js/dataDays.js", navigate: 'scroll', scale: 'days', maxScale: 'weeks', minScale: 'days', hollydays: ["\/Date(1293836400000)\/","\/Date(1294268400000)\/","\/Date(1303596000000)\/","\/Date(1306274400000)\/","\/Date(1304200800000)\/","\/Date(1304373600000)\/","\/Date(1307829600000)\/","\/Date(1308780000000)\/","\/Date(1313359200000)\/","\/Date(1320105600000)\/","\/Date(1320966000000)\/","\/Date(1324767600000)\/","\/Date(1324854000000)\/","\/Date(1325372400000)\/","\/Date(1325804400000)\/","\/Date(1333836000000)\/","\/Date(1336514400000)\/","\/Date(1335823200000)\/","\/Date(1335996000000)\/","\/Date(1338069600000)\/","\/Date(1339020000000)\/","\/Date(1344981600000)\/","\/Date(1351724400000)\/","\/Date(1352588400000)\/","\/Date(1356390000000)\/","\/Date(1356476400000)\/"]});
14+
//$(".gantt").gantt({source: dataPath + "js/dataHours.js", navigate: 'scroll', scale: 'hours', maxScale: 'hours', minScale: 'hours', hollydays: ["\/Date(1293836400000)\/","\/Date(1294268400000)\/","\/Date(1303596000000)\/","\/Date(1306274400000)\/","\/Date(1304200800000)\/","\/Date(1304373600000)\/","\/Date(1307829600000)\/","\/Date(1308780000000)\/","\/Date(1313359200000)\/","\/Date(1320105600000)\/","\/Date(1320966000000)\/","\/Date(1324767600000)\/","\/Date(1324854000000)\/","\/Date(1325372400000)\/","\/Date(1325804400000)\/","\/Date(1333836000000)\/","\/Date(1336514400000)\/","\/Date(1335823200000)\/","\/Date(1335996000000)\/","\/Date(1338069600000)\/","\/Date(1339020000000)\/","\/Date(1344981600000)\/","\/Date(1351724400000)\/","\/Date(1352588400000)\/","\/Date(1356390000000)\/","\/Date(1356476400000)\/"]});
15+
$(".gantt").gantt({source: dataPath + "js/dataDays.js", navigate: 'scroll', scale: 'days', maxScale: 'weeks', minScale: 'days', hollydays: ["\/Date(1293836400000)\/","\/Date(1294268400000)\/","\/Date(1303596000000)\/","\/Date(1306274400000)\/","\/Date(1304200800000)\/","\/Date(1304373600000)\/","\/Date(1307829600000)\/","\/Date(1308780000000)\/","\/Date(1313359200000)\/","\/Date(1320105600000)\/","\/Date(1320966000000)\/","\/Date(1324767600000)\/","\/Date(1324854000000)\/","\/Date(1325372400000)\/","\/Date(1325804400000)\/","\/Date(1333836000000)\/","\/Date(1336514400000)\/","\/Date(1335823200000)\/","\/Date(1335996000000)\/","\/Date(1338069600000)\/","\/Date(1339020000000)\/","\/Date(1344981600000)\/","\/Date(1351724400000)\/","\/Date(1352588400000)\/","\/Date(1356390000000)\/","\/Date(1356476400000)\/"]});
1616
});
1717
-->
1818
</script>

js/jquery.fn.gantt.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@
101101
if ((df.getMonth() == dt.getMonth())
102102
|| (df.getMonth() != dt.getMonth() && dt.getDate() >= 4))
103103
{
104-
return new Date(dt.getTime());
104+
return new Date(dt.setDate(dt.getDate()-3));
105105
} else
106106
{
107-
return new Date(df.getTime());
107+
return new Date(df.setDate(df.getDate()+3));
108108
}
109109
};
110110

@@ -172,6 +172,7 @@
172172
hPos = hPos > 0 ? 0 : hPos;
173173
$dataPanel.css({'margin-left': hPos+'px'});
174174
element.scrollNavigation.panelMargin = hPos;
175+
element.hPosition = hPos;
175176
element.scaleOldWidth = null;
176177
} else {
177178
$dataPanel.css({'margin-left': element.hPosition+'px'});

0 commit comments

Comments
 (0)