Skip to content

Commit 5a52561

Browse files
committed
1 day offset fix & simple test
1 parent ae8b8a4 commit 5a52561

File tree

6 files changed

+128
-10
lines changed

6 files changed

+128
-10
lines changed

index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ <h2>
425425
</div>
426426

427427
</body>
428-
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
428+
<script src="js/jquery.min.js"></script>
429429
<script src="js/jquery.fn.gantt.js"></script>
430430
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tooltip.js"></script>
431431
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-popover.js"></script>
@@ -520,9 +520,7 @@ <h2>
520520
}]
521521
}],
522522
navigate: "scroll",
523-
scale: "weeks",
524-
maxScale: "months",
525-
minScale: "days",
523+
maxScale: "hours",
526524
itemsPerPage: 10,
527525
onItemClick: function(data) {
528526
alert("Item clicked - show some details");

js/jquery-1.7.min.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

js/jquery.fn.gantt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@
742742

743743
dataPanel.append(yearArr.join(""));
744744
dataPanel.append(monthArr.join(""));
745-
dataPanel.append($('<div class="row"/>').html(dayArr.join("")));
746-
dataPanel.append($('<div class="row"/>').html(dowArr.join("")));
745+
dataPanel.append($('<div class="row" style="margin-left: 0;" />').html(dayArr.join("")));
746+
dataPanel.append($('<div class="row" style="margin-left: 0;" />').html(dowArr.join("")));
747747

748748
break;
749749
}

js/jquery.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/moment.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test01.html

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<!doctype html>
2+
<html lang="en-au">
3+
<head>
4+
<title>jQuery.Gantt - Test Suite 01</title>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
7+
<link rel="stylesheet" href="../css/style.css" />
8+
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
9+
<link rel="stylesheet" href="http://taitems.github.com/UX-Lab/core/css/prettify.css" />
10+
<style type="text/css">
11+
body {
12+
font-family: Helvetica, Arial, sans-serif;
13+
font-size: 13px;
14+
padding: 0 0 50px 0;
15+
}
16+
.contain {
17+
width: 800px;
18+
margin: 0 auto;
19+
}
20+
h1 {
21+
margin: 40px 0 20px 0;
22+
}
23+
h2 {
24+
font-size: 1.5em;
25+
padding-bottom: 3px;
26+
border-bottom: 1px solid #DDD;
27+
margin-top: 50px;
28+
margin-bottom: 25px;
29+
}
30+
table th:first-child {
31+
width: 150px;
32+
}
33+
</style>
34+
</head>
35+
<body>
36+
37+
<div class="contain">
38+
39+
<h1>
40+
jQuery.Gantt
41+
<small>&mdash; Test Suite 01</small>
42+
</h1>
43+
44+
<p>
45+
<strong>Expected behaviour:</strong> Gantt bar should run from "now" until 2 hours from now.
46+
</p>
47+
48+
<p>
49+
<strong>Errors:</strong>
50+
</p>
51+
<ul>
52+
<li>Hour views (1/3/6/9 hours) are all docked left</li>
53+
</ul>
54+
55+
<div class="gantt"></div>
56+
57+
58+
</body>
59+
<script src="../js/jquery.min.js"></script>
60+
<script src="../js/jquery.fn.gantt.js"></script>
61+
<script src="moment.min.js"></script>
62+
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tooltip.js"></script>
63+
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-popover.js"></script>
64+
<script src="http://taitems.github.com/UX-Lab/core/js/prettify.js"></script>
65+
<script>
66+
67+
$(function() {
68+
69+
"use strict";
70+
71+
72+
var today = moment();
73+
var andTwoHours = moment().add("hours",2);
74+
75+
var today_friendly = "/Date(" + today.valueOf() + ")/";
76+
var next_friendly = "/Date(" + andTwoHours.valueOf() + ")/";
77+
78+
//var today_friendly = today.toDate();
79+
//var next_friendly = andTwoHours.toDate();
80+
var maxDate = moment().add("days",10).toDate();
81+
82+
$(".gantt").gantt({
83+
source: [{
84+
name: "Testing",
85+
desc: " ",
86+
values: [{
87+
from: today_friendly,
88+
to: next_friendly,
89+
label: "Test",
90+
customClass: "ganttRed"
91+
}]
92+
}],
93+
scale: "hours",
94+
minScale: "hours",
95+
navigate: "scroll"
96+
});
97+
98+
$(".gantt").popover({
99+
selector: ".bar",
100+
title: "I'm a popover",
101+
content: "And I'm the content of said popover.",
102+
trigger: "hover"
103+
});
104+
105+
console.log(today.format("HH"));
106+
107+
prettyPrint();
108+
109+
});
110+
111+
</script>
112+
</html>

0 commit comments

Comments
 (0)