Fix date range negative month
This commit is contained in:
parent
e648988b53
commit
fcd8447658
@ -53,8 +53,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function timeshift_month(date, diff) {
|
function timeshift_month(date, diff) {
|
||||||
var month = date.getMonth() + diff;
|
var month = date.getMonth() + diff, month_mod12 = month%12;
|
||||||
return new Date(date.getFullYear() + Math.floor(month/12), month >= 0 ? (month%12) : (month%12 + 12), date.getDate());
|
return new Date(date.getFullYear() + Math.floor(month/12), month_mod12 >= 0 ? (month_mod12) : (month_mod12 + 12), date.getDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
function datecalc(date, range, direction) {
|
function datecalc(date, range, direction) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user