|
|
| Line 1: |
Line 1: |
| {{#if:{{{monthoffset|}}}|
| | {{#if:{{{getoffsetday|}}}|{{#if:{{cal-date/offset_recurs|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}{{cal-date/offset_recurs|isnextmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{#if:{{cal-date/offset_recurs|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{cal-date/offset_recurs|daysinmonth={{cal-date/offset_recurs|getoffsetmonth={{{month}}}|offset={{{offset|0}}}|day={{{getoffsetday}}}}}}}|1}}|{{#expr: {{{getoffsetday}}} + {{{offset|0}}}}}}}|}} |
| {{#switch:{{#expr: {{{monthoffset}}} + {{{offset|0}}}}}
| | <noinclude>[[Category:Meta templates]]</noinclude> |
| |0=12
| |
| |13=1
| |
| |{{#expr: {{{monthoffset}}} + {{{offset|0}}}}}
| |
| }}
| |
| |}}<!--
| |
| | |
| Get the number of days in a month
| |
| | |
| -->{{#if:{{{daysinmonth|}}}|
| |
| {{#switch:{{{daysinmonth}}}
| |
| |1=31
| |
| |2=29
| |
| |3=31
| |
| |4=30
| |
| |5=31
| |
| |6=30
| |
| |7=31
| |
| |8=31
| |
| |9=30
| |
| |10=31
| |
| |11=30
| |
| |12=31
| |
| |
| |
| }}|}}<!--
| |
| | |
| isnextmonth
| |
| params: isnextMonth (day), offset, month
| |
| | |
| -->{{#if:{{{isnextmonth|}}}|{{#ifeq:{{#expr: ({{{isnextmonth}}} + {{{offset|0}}}) > {{cal-date/offset_recurs|daysinmonth={{{month|}}}}} }}|1|1|}}|}}<!--
| |
| | |
| isprevmonth
| |
| 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/offset_recurs|isprevmonth={{{day}}}|offset={{{offset}}}|month={{{getoffsetmonth}}}}}{{cal-date/offset_recurs|isnextmonth={{{day}}}|offset={{{offset}}}|month={{{getoffsetmonth}}}}}|{{cal-date/offset_recurs|monthoffset={{{getoffsetmonth}}}|offset={{{offset|0}}}}}|{{{getoffsetmonth}}}}}|}}<!--
| |
| | |
| 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:{{{getoffsetday|}}}|{{#if:{{cal-date/offset_recurs|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}{{cal-date/offset_recurs|isnextmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{#if:{{cal-date/offset_recurs|isprevmonth={{{getoffsetday}}}|offset={{{offset}}}|month={{{month}}}}}|{{cal-date/offset_recurs|daysinmonth={{cal-date/offset_recurs|getoffsetmonth={{{month}}}|offset={{{offset|0}}}|day={{{getoffsetday}}}}}}}|1}}|{{#expr: {{{getoffsetday}}} + {{{offset|0}}}}}}}|}}<!--
| |
| | |
| -->
| |