+
+ # Filling potential gaps in years (e.g. calendar goes from 2010 to 2014,
+ # and we just added year 2005. We have to had years 2006 to 2009).
+ return if $params{norecurse};
+ if ($wikistate{calendar}{minyear} > $year) {
+ foreach my $other ($year + 1 .. $wikistate{calendar}{minyear} - 1) {
+ gencalendaryear($other, norecurse => 1);
+ }
+ $wikistate{calendar}{minyear} = $year;
+ }
+ if ($wikistate{calendar}{maxyear} < $year) {
+ foreach my $other ($wikistate{calendar}{maxyear} + 1 .. $year - 1) {
+ gencalendaryear($other, norecurse => 1);
+ }
+ $wikistate{calendar}{maxyear} = $year;
+ }
+ }
+ if ($year < $wikistate{calendar}{minyear}) {
+ $wikistate{calendar}{minyear} = $year;
+ }
+ if ($year > $wikistate{calendar}{maxyear}) {