Changes

Jump to navigation Jump to search
no edit summary
The template will store up to four values:
* <code><nowiki>{{{property|}}}</nowiki></code> - the combined date.
* <code><nowiki>{{{property|}}} Era</nowiki></code> - BCE or CE; default is CE.
* <code><nowiki>{{{property|}}} Year</nowiki></code> - the year part.
* <code><nowiki>{{{property|}}} Month</nowiki></code> - the month part.
* <code><nowiki>{{{property|}}} Day</nowiki></code> - the day part.
* <code><nowiki>{{{property|}}} Approximate</nowiki></code> - if true, the date is approximate; the default is false.
'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
'''Parameters:'''
* <code><nowiki>|property=</nowiki></code> - the name of the property.
* <code><nowiki>|era=</nowiki></code> - the era: BCE or CE. The default is CE.* <code><nowiki>|year=</nowiki></code> - the year; mandatory. '''YYYY BC and YYYY BCE formats are allowed for BC years.'''
* <code><nowiki>|month=</nowiki></code> - the month.
* <code><nowiki>|day=</nowiki></code> - the day.
* <code><nowiki>|approximate=</nowiki></code> - if true, the date will be considered approximate (circa); this value is not passed to SMW, since the latter doesn't support approximate dates, but will be useful when printing dates (e.g. ''circa. 480 BC'').
</noinclude><includeonly><!--
-->{{#if: {{{property|}}}<!--
--><!-- set individual values and build the overall date string
-->|{{#if: {{{year|}}}<!-- --><!-- --><!-- check if BC this there is a BC no year -->|{{#if: {{#pos:{{{year|}}}|BC}}<!-- -->|{{#vardefine: varYear|{{#sub:{{{year|}}}|0|{{#pos:{{{year|}}}|BC}}}}}}<!-- remove BC from the year to use time functions -->|{{#vardefine: varYear|{{{year|}}} }}<!-- -->}}<!-- if BC --><!-- -->{{#if: {{{month|}}}<!-- -->|{{#if: {{{day|}}}<!-- -->|{{#set: {{{property|}}} Year={{#time:Y|{{#var:varYear}}-{{{month|}}}-{{{day|}}} }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- store year -->{{#set: {{{property|}}} Month={{#time:F|{{#var:varYear}}-{{{month|}}}-{{{day|}}} }}|}}<!-- store month -->{{#set: {{{property|}}} Day={{#time:j|{{#var:varYear}}-{{{month|}}}-{{{day|}}} }}|}}<!-- store day -->{{#set: {{{property|}}}={{#time:j F Y|{{#var:varYear}}-{{{month|}}}-{{{day|}}} }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- all components are present -->|{{#set: {{{property|}}} Year={{#time:Y|{{#var:varYear}}-{{{month|}}}-28 }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- store year -->{{#set: {{{property|}}} Month={{#time:F|{{#var:varYear}}-{{{month|}}}-28 }}|}}<!-- store month -->{{#set: {{{property|}}}={{#time:F Y|{{#var:varYear}}-{{{month|}}}-28 }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- only month and year are present -->}}<!-- if day -->|{{#set: {{{property|}}} Year={{#time:Y|{{#var:varYear}} }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- store year -->{{#set: {{{property|}}}={{#time:Y|{{#var:varYear}} }} {{#if: {{#pos:{{{year|}}}|BC}}|BC|}} |}}<!-- only year is present -->}}<!-- if month,
--><!--
-->{{#if: {{{month|}}}<!--
-->|{{#if: {{{day|}}}<!--
-->|{{#set: {{{property|}}} Year={{#time:Y|{{{year|}}}-{{{month|}}}-{{{day|}}} }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}}<!-- store year
-->{{#set: {{{property|}}} Month={{#time:F|{{{year|}}}-{{{month|}}}-{{{day|}}} }}|}}<!-- store month
-->{{#set: {{{property|}}} Day={{#time:j|{{{year|}}}-{{{month|}}}-{{{day|}}} }}|}}<!-- store day
-->{{#set: {{{property|}}}={{#time:j F Y|{{{year|}}}-{{{month|}}}-{{{day|}}} }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}} |}}<!-- all components are present
-->|{{#set: {{{property|}}} Year={{#time:Y|{{{year|}}}-{{{month|}}}-28 }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}} |}}<!-- store year
-->{{#set: {{{property|}}} Month={{#time:F|{{{year|}}}-{{{month|}}}-28 }}|}}<!-- store month
-->{{#set: {{{property|}}}={{#time:F Y|{{{year|}}}-{{{month|}}}-28 }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}} |}}<!-- only month and year are present
-->}}<!-- if day
-->|{{#set: {{{property|}}} Year={{#time:Y|{{{year|}}} }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}} |}}<!-- store year
-->{{#set: {{{property|}}}={{#time:Y|{{{year|}}} }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}} |}}<!-- only year is present
-->}}<!-- if month
--><!--
-->{{#set: {{{property|}}} Era={{{era|CE}}}|}}<!-- set the era; CE is default
-->{{#set: {{{property|}}} Approximate={{{approximate|false}}}|}}<!-- set approximate;false is default
--><!--
-->}}<!-- if year
-->}}<!-- if property
--></includeonly>

Navigation menu