< Template:VFG | Time
Jump to navigation
Jump to search
(Sorry Skizzerz, I'm an idiot. I was wrong about this one particular problem. There is another one.) |
(Partial fix: Default values on all #switch operators.) |
||
Line 1: | Line 1: | ||
{{#vardefine:old|{{#switch:{{{month}}}|01=0|02=31|03=59|04=90|05=120|06=151|07=181|08=211|09=242|10=272|11=303| | {{#vardefine:leap|0}}{{#vardefine:old|{{#switch:{{{month}}}|01=0|02=31|03=59|04=90|05=120|06=151|07=181|08=211|09=242|10=272|11=303|333}}}}{{#vardefine:a|{{#ifeq:{{#expr:{{{month}}}>2}}|1|0|-30}}}}{{#vardefine:a|{{#ifeq:{{#expr:{{{year}}} mod 400}}|0|{{#expr:{{#var:a}}+2}}|{{#var:a}}}}}}{{#vardefine:a|{{#ifeq:{{#expr:{{{year}}} mod 100}}|0|{{#expr:{{#var:a}}+4}}|{{#var:a}}}}}}{{#vardefine:a|{{#ifeq:{{#expr:{{{year}}} mod 4}}|0|{{#expr:{{#var:a}}+8}}|{{#var:a}}}}}}{{#vardefine:old|{{#switch:{{#var:a}}|2|6|8|10|14={{#expr:{{#var:old}}+1}}{{#vardefine:leap|1}}|{{#var:old}}}}}}{{#vardefine:current|{{#switch:{{CURRENTMONTH}}|01=0|02=31|03=59|04=90|05=120|06=151|07=181|08=211|09=242|10=272|11=303|333}}}}{{#vardefine:b|{{#ifeq:{{#expr:{{CURRENTMONTH}}>2}}|1|0|-30}}}}{{#vardefine:b|{{#ifeq:{{#expr:{{CURRENTYEAR}} mod 400}}|0|{{#expr:{{#var:b}}+2}}|{{#var:b}}}}}}{{#vardefine:b|{{#ifeq:{{#expr:{{CURRENTYEAR}} mod 100}}|0|{{#expr:{{#var:b}}+4}}|{{#var:b}}}}}}{{#vardefine:b|{{#ifeq:{{#expr:{{CURRENTYEAR}} mod 4}}|0|{{#expr:{{#var:b}}+8}}|{{#var:b}}}}}}{{#vardefine:current|{{#switch:{{#var:b}}|2|6|8|10|14={{#expr:{{#var:current}}+1}}|{{#var:current}}}}}}{{#vardefine:current|{{#expr:{{#var:current}}+({{CURRENTYEAR}}-{{{year}}})*364}}}}{{#vardefine:current|{{#ifeq:{{#expr:{{CURRENTYEAR}}-{{{year}}}!=0 and {{#var:leap}}=1}}|1|{{#expr:{{#var:current}}+1}}|{{#var:current}}}}}}{{#vardefine:old|{{#expr:{{{day}}}+{{#var:old}}}}}}{{#vardefine:current|{{#expr:{{CURRENTDAY}}+{{#var:current}}}}}}{{#vardefine:shade|{{#expr:{{#var:current}}-{{#var:old}}}}}}{{#switch:{{#var:shade}} | ||
|1=FAFAFA | |1=FAFAFA | ||
|2=F5F5F5 | |2=F5F5F5 |
Revision as of 21:56, 16 August 2007
FFFFFF
Do not modify this template unless your knowledge of parser functions is very high! This template gives a color code based off of a given time and the current time. It alternates from white, to gray, to black, to blue, and then back to white, where it stops.