Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,30 @@ <h2 id="config">
Array of numbers (ms), date strings (see&nbsp;<a href="http://dygraphs.com/date-formats.html" target="_blank">formats</a>), or Date objects
</td>
</tr>
<tr>
<td>
<code>minDate</code>
</td>
<td>
<code>undefined</code>
</td>
<td>
Date strings (see&nbsp;<a href="http://dygraphs.com/date-formats.html" target="_blank">formats</a>), or Date objects.</br>
Define minimum Date which the chart will show. If <code>undefined</code> the minimum date will be calculated from the <code>source</code>.
</td>
</tr>
<tr>
<td>
<code>maxDate</code>
</td>
<td>
<code>undefined</code>
</td>
<td>
Date strings (see&nbsp;<a href="http://dygraphs.com/date-formats.html" target="_blank">formats</a>), or Date objects</br>
Define maximum Date which the chart will show. If <code>undefined</code> the maxium date will be calculated from the <code>source</code>.
</td>
</tr>
<tr>
<td>
<code>navigate</code>
Expand Down
18 changes: 14 additions & 4 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@
var settings = {
source: [],
holidays: [],
minDate : null,
maxDate : null,
// paging
itemsPerPage: 7,
// localisation
Expand Down Expand Up @@ -1462,8 +1464,12 @@
case "days":
/* falls through */
default:
maxDate.setHours(0);
maxDate.setDate(maxDate.getDate() + 3);
if (settings.maxDate == null) {
maxDate.setHours(0);
maxDate.setDate(maxDate.getDate() + 3);
} else {
maxDate = tools.dateDeserialize(settings.maxDate);
}
}
return maxDate;
},
Expand Down Expand Up @@ -1498,8 +1504,12 @@
case "days":
/* falls through */
default:
minDate.setHours(0, 0, 0, 0);
minDate.setDate(minDate.getDate() - 3);
if (settings.minDate == null) {
minDate.setHours(0, 0, 0, 0);
minDate.setDate(minDate.getDate() - 3);
} else {
minDate = tools.dateDeserialize(settings.minDate);
}
}
return minDate;
},
Expand Down