diff --git a/index.html b/index.html index dd193db..9268a5f 100644 --- a/index.html +++ b/index.html @@ -166,6 +166,30 @@

Array of numbers (ms), date strings (see formats), or Date objects + + + minDate + + + undefined + + + Date strings (see formats), or Date objects.
+ Define minimum Date which the chart will show. If undefined the minimum date will be calculated from the source. + + + + + maxDate + + + undefined + + + Date strings (see formats), or Date objects
+ Define maximum Date which the chart will show. If undefined the maxium date will be calculated from the source. + + navigate diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index 564f419..113b0ad 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -174,6 +174,8 @@ var settings = { source: [], holidays: [], + minDate : null, + maxDate : null, // paging itemsPerPage: 7, // localisation @@ -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; }, @@ -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; },