Difference between revisions of "Template:THDayofWeek"

From Twilight Heroes Wiki
Jump to: navigation, search
m (Trial #2)
(correcting for the loss of two days in July 2009)
Line 1: Line 1:
<!-- This function works by finding the number of days which have elapsed since the 16th November 2008, which was a Sunday, and which also was the day after this function was (first) made. --><includeonly>{{#ifeq:{{{1|?}}}|? <!-- checks for an EVALUATION statement, if argument exists -->
+
<!-- This function works by finding the number of days which have elapsed since the 16th November 2008, which was a Sunday, and which also was the day after this function was (first) made. This is adjusted for the two days lost in July 2009--><includeonly>{{#ifeq:{{{1|?}}}|? <!-- checks for an EVALUATION statement, if argument exists -->
 
|{{#switch: <!-- SWITCH for determining name of day -->
 
|{{#switch: <!-- SWITCH for determining name of day -->
 
   {{#expr:
 
   {{#expr:
Line 10: Line 10:
 
       - 1776 <!-- Day number for the 16th November 2008 using this formula -->
 
       - 1776 <!-- Day number for the 16th November 2008 using this formula -->
 
       + (({{#time: H}} >= 4) and ({{#time: i}} >= 10) or ({{#time: H}} >= 5))
 
       + (({{#time: H}} >= 4) and ({{#time: i}} >= 10) or ({{#time: H}} >= 5))
 +
      + 2 <!-- For the two days lost in July 2009 -->
 
     ) mod 6}}
 
     ) mod 6}}
 
   |0=Sunday
 
   |0=Sunday
Line 39: Line 40:
  
 
==Function==
 
==Function==
Returns the day of the week of any day after 17 November 2008.
+
Returns the day of the week of any day after 10 July 2009.
  
 
==Sample==
 
==Sample==
 
<b>Today is {{</b><b>THDayofWeek}}</b> returns:<br>
 
<b>Today is {{</b><b>THDayofWeek}}</b> returns:<br>
 
Today is {{THDayofWeek}}<br><br>
 
Today is {{THDayofWeek}}<br><br>
<b>17 April 2009 is {{</b><b>THDayofWeek|17 April 2009}}</b> returns:<br>
+
<b>17 July 2009 is {{</b><b>THDayofWeek|17 July 2009}}</b> returns:<br>
17 April 2009 is {{THDayofWeek|17 April 2009}}
+
17 July 2009 is {{THDayofWeek|17 July 2009}}
 
</noinclude>
 
</noinclude>

Revision as of 03:11, 2 August 2009

Variable

Returns the day of the week in the game of today

Function

Returns the day of the week of any day after 10 July 2009.

Sample

Today is {{THDayofWeek}} returns:
Today is Thewsday

17 July 2009 is {{THDayofWeek|17 July 2009}} returns:
17 July 2009 is Thewsday