Module:FeaturedArticleBar

local p = {} function p.link( frame ) local sTime = frame.args[1] local sLink = frame.args[2] local iMonthnr = os.date( "%m" ) local iPrevMonth = iMonthnr - 1 local iNextMonth = iMonthnr + 1 local iWeeknr = os.date( "%W" ) local iPrevWeek = iWeeknr - 1 local iNextWeek = iWeeknr + 1 local iArticlenr if sLink == 'prev' then if sTime == 'week' then if iPrevWeek == '52' then iArticlenr = '51' elseif iPrevWeek == '0' then iArticlenr = '52' else iArticlenr = iPrevWeek end else if iPrevMonth == '0' then iArticlenr = '12' else iArticlenr = iPrevMonth end end else if sTime == 'week' then if iNextWeek == '53' or iNextWeek == '54' then iArticlenr = '1' else iArticlenr = iNextWeek end else if iNextMonth == '13' then iArticlenr = '1' else iArticlenr = iNextMonth end end end return iArticlenr end return p