- $pagestate{$params{destpage}}{calendar}{nextchange}=
- timelocal(0, 0, 0, 1, $params{month}-1, $params{year});
+ setnextchange($params{destpage},
+ timelocal(0, 0, 0, 1, $params{month}-1, $params{year}));
+ }
+ elsif (($params{type} eq 'year' && $params{year} == $thisyear) ||
+ $relativemonth) {
+ # Calendar for current year updates 1st of next month.
+ # Any calendar relative to the current month also updates
+ # then.
+ if ($thismonth < 12) {
+ setnextchange($params{destpage},
+ timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year}));
+ }
+ else {
+ setnextchange($params{destpage},
+ timelocal(0, 0, 0, 1, 1-1, $params{year}+1));
+ }