Open main menu

Changes

no edit summary
* <code><nowiki>|property=</nowiki></code> - the name of the property.
* <code><nowiki>|datestring=</nowiki></code> - the date value in yyyy/mm/dd format. The month and day are optional. '''YYYY BC and YYYY BCE formats are allowed for BC years.'''
* <code><nowiki>|reporterror=</nowiki></code> - if given, an error message will be printed if no date is found in datestring.
</noinclude><includeonly><!--
-->{{#if: {{{property|}}}<!--
--><!-- set individual values and build the overall date string
-->|{{#vardefine: varSlash1|{{#pos:{{{datestring|}}}|/}}|}}<!-- search for the first occurrence of slash
-->{{#switch: {{#var: varSlash1}}<!--
-->|0={{#if: {{{reporterror|}}}| The datestring of property {{{property|}}} doesn't contain any date. |}}<!-- slash is the first symbol: don't do anyhting
-->|{{#vardefine: varYear|{{#sub:{{{datestring|}}}|0|{{#expr: {{#var: varSlash1}}}} }}|}}<!-- extract the year
-->{{#vardefine: varSlash2|{{#pos:{{{datestring|}}}|/|{{#expr: {{#var: varSlash1}}+1}} }}|}}<!-- search for the next occurrence of slash