Commit f14c708e authored by Johannes Bill's avatar Johannes Bill

fixed error with change of year

parent 3b013462
...@@ -292,15 +292,17 @@ function createWeekViewVertical(dataObj, now) { ...@@ -292,15 +292,17 @@ function createWeekViewVertical(dataObj, now) {
function createMonthView(dataObj, now, monthOffset) { function createMonthView(dataObj, now, monthOffset) {
var currentMonth = now.getMonth() + monthOffset; var currentMonth = now.getMonth() + monthOffset;
var startDate = new Date(now.getFullYear(), currentMonth, 1); var startDate = new Date(now.getFullYear(), now.getMonth() + monthOffset, 1);
var monthDate = new Date(startDate); var monthDate = new Date(startDate);
startDate.setDate(2 - startDate.getDay()); startDate.setDate(2 - startDate.getDay());
var endDate = new Date(now.getFullYear(), currentMonth + 1, 1); var endDate = new Date(now.getFullYear(), currentMonth + 1, 1);
if (endDate.getDay() != 1) if (endDate.getDay() != 1)
endDate.setDate(9 - endDate.getDay()); endDate.setDate(9 - endDate.getDay());
currentMonth = currentMonth % 12;
//TODO: only transform once for 3 month view //TODO: only transform once for 3 month view
var oHours = transformData(dataObj, startDate, endDate); var oHours = transformData(dataObj, startDate, endDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment