- elsif ($params{type} eq 'year' && $params{year} == $thisyear) {
- # calendar for current year, updates 1st of next month
- $pagestate{$params{destpage}}{calendar}{nextchange}=
- timelocal(0, 0, 0, 1, $thismonth+1-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));
+ }
+ }
+ elsif ($relativeyear) {
+ # Any calendar relative to the current year updates 1st
+ # of next year.
+ setnextchange($params{destpage},
+ timelocal(0, 0, 0, 1, 1-1, $thisyear+1));