Difference between revisions of "Template:WeekDiff"
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | <!-- | |
+ | 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 | ||
− | + | {{#timel: Y}} is de huidige tijdvariabele uitgedrukt in jaar | |
+ | {{#timel: W}} is de huidige tijdvariabele uitgedrukt in week | ||
− | + | FORMAT: {{WeekDiff|<yearnumber>|<weeknumber>}} | |
+ | Valid Calls: | ||
+ | {{WeekDiff|2010|24}} | ||
− | | {{#expr:( {{{1}}}-{{#timel: Y}})*52-{{#timel: W}}+{{{2}}} }} | + | DO NOT call as follows: |
− | + | {{WeekDiff | 10}} | |
− | }} | + | BE CAREFULL NOT TO INTRODUCE unintentional SPACES AND CR'S in the following statement |
− | + | --> | |
− | |{{#expr:{{{2}}}-{{#timel: W}} }} | + | {{#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 "{".