+ }
+ elsif ($params{type} eq 'month' &&
+ (($params{year} == $thisyear && $params{month} > $thismonth) ||
+ $params{year} > $thisyear)) {
+ # calendar for upcoming month, updates 1st of that month
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, $params{month}-1, $params{year});
+ }
+ elsif ($params{type} eq 'year' && $params{year} == $thisyear) {
+ # calendar for current year, updates 1st of next month
+ if ($thismonth < 12) {
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year});
+ }
+ else {
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, 1-1, $params{year}+1);
+ }
+ }
+ elsif ($params{type} eq 'year' && $params{year} > $thisyear) {
+ # calendar for upcoming year, updates 1st of that year
+ $pagestate{$params{destpage}}{calendar}{nextchange}=
+ timelocal(0, 0, 0, 1, 1-1, $params{year});