Template:Cal-date/offset: Difference between revisions
From MediaWiki
Jump to navigationJump to searchmNo edit summary |
mNo edit summary |
||
| (16 intermediate revisions by 3 users not shown) | |||
| Line 29: | Line 29: | ||
params: isnextMonth (day), offset, month | params: isnextMonth (day), offset, month | ||
-->{{#if:{{{isnextmonth|}}}|{{#ifeq:{{#expr: ({{{isnextmonth}}} + {{{offset|0}}}) > {{cal-date/ | -->{{#if:{{{isnextmonth|}}}|{{#ifeq:{{#expr: ({{{isnextmonth}}} + {{{offset|0}}}) > {{cal-date/offset2|daysinmonth={{{month|}}}}} }}|1|1|}}|}}<!-- | ||
isprevmonth | |||
NOTE: | params: isprevMonth (day), offset, month | ||
-->{{#if:{{{isprevmonth|}}}|{{#ifeq:{{#expr: ({{{isprevmonth}}} + {{{offset|0}}}) < 1}}|1|1|}}|}}<!-- | |||
getoffsetmonth | |||
params: getoffsetmonth (month), offset, day | |||
returns: a numeric month | |||
NOTE: WILL NOT WORK CORRECTLY IF THE OFFSET IS MORE THAN A SINGLE DAY | |||
--> | -->{{#if:{{{getoffsetmonth|}}}|{{#if:{{cal-date/offset2|isprevmonth={{{day}}}|offset={{{offset}}}|month={{{getoffsetmonth}}}}}{{cal-date/offset2|isnextmonth={{{day}}}|offset={{{offset}}}|month={{{getoffsetmonth}}}}}|{{cal-date/offset2|monthoffset={{{getoffsetmonth}}}|offset={{{offset|0}}}}}|{{{getoffsetmonth}}}}}|}}<!-- | ||
{{#if | |||
getoffsetday - Get the day offset | |||
NOTE: THIS DOES NOT WORK IF THE NUMBER OF DAYS BEING OFFSET IS MORE THAN 1, SUCK ON IT. | |||
params: getoffsetday (day), offset, month | |||
if | -->{{#if:{{{getoffsetday|}}}|{{#if:{{cal-date/offset2|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}{{cal-date/offset2|isnextmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{#if:{{cal-date/offset2|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{cal-date/offset2|daysinmonth={{cal-date/offset2|getoffsetmonth={{{month}}}|offset={{{offset|0}}}|day={{{getoffsetday}}}}}}}|1}}|pew{{#expr: {{{getoffsetday}}} + {{{offset|0}}}}}}}|}}<!-- | ||
|}} | |||
--> | --><noinclude>[[Category:Meta templates]]</noinclude> | ||

