diff --git a/htdocs/DateRangePicker.vue b/htdocs/DateRangePicker.vue index 5a3763b..71e130c 100644 --- a/htdocs/DateRangePicker.vue +++ b/htdocs/DateRangePicker.vue @@ -53,8 +53,8 @@ } function timeshift_month(date, diff) { - var month = date.getMonth() + diff; - return new Date(date.getFullYear() + Math.floor(month/12), month >= 0 ? (month%12) : (month%12 + 12), date.getDate()); + var month = date.getMonth() + diff, month_mod12 = month%12; + return new Date(date.getFullYear() + Math.floor(month/12), month_mod12 >= 0 ? (month_mod12) : (month_mod12 + 12), date.getDate()); } function datecalc(date, range, direction) {