localp={}functionp.countdown(frame)localyear1=tonumber(frame.args.year1orframe.args[1])localmonth1=tonumber(frame.args.month1orframe.args[2])localday1=tonumber(frame.args.day1orframe.args[3])localyear2=tonumber(frame.args.year2orframe.args[4])localmonth2=tonumber(frame.args.month2orframe.args[5])localday2=tonumber(frame.args.day2orframe.args[6])localendtext=frame.args.endtextor"End of Event"locallivetext=frame.args.livetextor"Live Event"localtext=frame.args.textlocaltime1=nillocaltime2=nillocalbgcolor="#666666"localtextcolor="#DDDDDD"localspan=mw.html.create("span")span:css{["display"]="inline-block",["font-weight"]="bold",["font-style"]="italic",["padding-left"]="0.5em",["padding-right"]="0.5em",["margin-bottom"]="0.4em"}iftext~=nilorday1==nilormonth1==niloryear1==nilthenspan:css{background=bgcolor,color=textcolor}:wikitext(textor"Invalid input")returntostring(span)endtime1=frame:expandTemplate{title="Age in days",args={year2=year1,month2=month1,day2=day1}}time1=tonumber(time1:gsub("−","-").."")ifday2==nilormonth2==niloryear2==nilthentime2=time1elsetime2=frame:expandTemplate{title="Age in days",args={year2=year2,month2=month2,day2=day2}}time2=tonumber(time2:gsub("−","-").."")endiftime1>0thenbgcolor="#C66320"text=time1.." day"iftime1>1thentext=text.."s"endtext=text.." to go"elseiftime2<0thenbgcolor="#AA1111"text=endtextelsebgcolor="#00B000"text=livetextendtextcolor="#FFFFFF"span:css{background=bgcolor,color=textcolor}:wikitext(text)returntostring(span)endreturnp