Simplify forward_day and backward_day

This commit is contained in:
Bart Visscher 2011-09-01 22:29:57 +02:00
parent e765e7e9e8
commit b7e9e7e777
1 changed files with 10 additions and 30 deletions

View File

@ -91,27 +91,17 @@ Calendar={
oc_cal_year++;
oc_cal_month = 0;
oc_cal_dayofmonth = 1;
if(oc_cal_dayofweek == 6) {
oc_cal_dayofweek = 0;
} else {
oc_cal_dayofweek++;
}
} else {
oc_cal_month++;
oc_cal_dayofmonth = 1;
if(oc_cal_dayofweek == 6) {
oc_cal_dayofweek = 0;
} else {
oc_cal_dayofweek++;
}
}
} else {
oc_cal_dayofmonth++;
if(oc_cal_dayofweek == 6) {
oc_cal_dayofweek = 0;
} else {
oc_cal_dayofweek++;
}
}
if(oc_cal_dayofweek == 6) {
oc_cal_dayofweek = 0;
} else {
oc_cal_dayofweek++;
}
},
@ -135,27 +125,17 @@ Calendar={
oc_cal_year--;
oc_cal_month = 11;
oc_cal_dayofmonth = 31
if(oc_cal_dayofweek == 0) {
oc_cal_dayofweek = 6;
} else {
oc_cal_dayofweek--;
}
} else {
oc_cal_month--;
oc_cal_dayofmonth = cal[oc_cal_month];
if(oc_cal_dayofweek == 0) {
oc_cal_dayofweek = 6;
} else {
oc_cal_dayofweek--;
}
}
} else {
oc_cal_dayofmonth--;
if(oc_cal_dayofweek == 0) {
oc_cal_dayofweek = 6;
} else {
oc_cal_dayofweek--;
}
}
if(oc_cal_dayofweek == 0) {
oc_cal_dayofweek = 6;
} else {
oc_cal_dayofweek--;
}
},