-- This module powers {{interval}}.localp={}-- Constantslocallang=mw.language.getContentLanguage()localgetArgs=require('Module:Arguments').getArgslocalfunctiongetArgNums(args)-- Returns an array containing the keys of all positional arguments-- that contain data (i.e. non-whitespace values).-- (from Module:Unbulleted_list)localnums={}fork,vinpairs(args)doiftype(k)=='number'andk>=1andmath.floor(k)==kandmw.ustring.match(v,'%S')thentable.insert(nums,k)endendtable.sort(nums)returnnumsendfunctionp.main(frame)localargs=getArgs(frame)returnp._main(args)endfunctionp._main(args)localn,rule,format=args.n,args.rule,args.formatlocalnumbers=getArgNums(args)locallow,high,lowpos,highpos=nil,nil,0,#numbers+1-- If comparing times, convert them all to seconds after the epochifformat=='time'thenifnthenn=lang:formatDate('U','@'..n)elsen=os.time()-- Set n to now if no time providedendendn=tonumber(n)fori,numinipairs(numbers)dolocalintervalifformat=='time'theninterval=tonumber(lang:formatDate('U','@'..args[num]))elseinterval=tonumber(args[num])endifnand((n>=intervalandnotrule)or(n>intervalandrule=='>'))thenlow=intervallowpos=numelsehigh=highandmath.min(interval,high)orintervalifhigh==intervalthenhighpos=numendendendreturnlowpos..'-'..highposendreturnp