Difference between revisions of "Template:WeekDiff"

From 2value wiki 2
Jump to navigation Jump to search
(Created page with '{{#ifexpr: {{{1}}} <> {{#timel: Y}} | {{#expr:( {{{1}}}-{{#timel: Y}} )*52+{{#timel: W}}-{{{2}}} }} |{{#expr:{{{2}}}-{{#timel: W}} }} }}')
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifexpr: {{{1}}} <> {{#timel: Y}}  
+
<!--
 +
Henk van Cann may 3th 2010: WeekDiff calculates the differences in weeks between the current date and the two arguments that are given
 +
{{{1}}} is the year
 +
{{{2}}} is the week
  
| {{#expr:( {{{1}}}-{{#timel: Y}} )*52+{{#timel: W}}-{{{2}}}  }}
+
{{#timel: Y}} is de huidige tijdvariabele uitgedrukt in jaar
 +
{{#timel: W}} is de huidige tijdvariabele uitgedrukt in week
  
|{{#expr:{{{2}}}-{{#timel: W}}  }}
+
FORMAT: {{WeekDiff|<yearnumber>|<weeknumber>}}
 +
Valid Calls:
 +
{{WeekDiff|2010|24}}
 +
 
 +
DO NOT call as follows:
 +
{{WeekDiff | 10}}
 +
BE CAREFULL NOT TO INTRODUCE unintentional SPACES AND CR'S in the following statement
 +
-->
 +
{{#ifexpr: {{{1}}}!={{#timel: Y}}
 +
| {{#ifexpr: {{{1}}} > {{#timel: Y}}
 +
|  {{#expr:( {{{1}}}-{{#timel: Y}})*52+{{#timel: W}}+{{{2}}}  }}
 +
|  {{#expr:( {{{1}}}-{{#timel: Y}})*52-{{#timel: W}}+{{{2}}}  }}  }}
 +
| {{#expr: {{{2}}}-{{#timel: W}}  }}
 
}}
 
}}

Latest revision as of 13:00, 3 May 2010

Expression error: Unrecognized punctuation character "{".