Open main menu

Changes

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 ''Yes'', the date is approximate; the default is ''No''.
'''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
 
'''As of now, the function doesn't support BC years.'''
'''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.
* <code><nowiki>|month=</nowiki></code> - the month.
* <code><nowiki>|day=</nowiki></code> - the day.
* <code><nowiki>|approximate=</nowiki></code> - if ''Yes'', 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|}}}<!-- if there is no year, --><!--
-->|{{#if: {{{month|}}}<!--
-->|{{#if: {{{day|}}}<!-- -->|{{#set: {{{property|}}} Year={{#time:Y|{{{yearday|}}}-{{{month|}}}-{{{dayyear|}}} }}|}}<!-- store year -->{{#set: {{{property|}}} Month={{#time:F|{{{yearday|}}}-{{{month|}}}-{{{dayyear|}}} }}|}}<!-- store month -->{{#set: {{{property|}}} Day={{#time:j|{{{yearday|}}}-{{{month|}}}-{{{dayyear|}}} }}|}}<!-- store day -->{{#set: {{{property|}}}={{#time:j F Y|{{{yearday|}}}-{{{month|}}}-{{{dayyear|}}} }} {{#ifeq: {{{era|CE}}} |BCE|BCE|}}|}}<!-- all components are present given -->|{{#set: {{{property|}}} Year={{#time:Y|28 {{{yearmonth|}}}-{{{monthyear|}}}-28 }}|}}<!-- store year -->{{#set: {{{property|}}} Month={{#time:F|28 {{{yearmonth|}}}-{{{monthyear|}}}-28 }}|}}<!-- store month -->{{#set: {{{property|}}}={{#time:F Y|28 {{{month|}}} {{{year|}}}-}} {{#ifeq: {{{monthera|CE}}}-28 |BCE|BCE|}}|}}<!-- only month and year are presentgiven -->}}<!-- if day -->|{{#set: {{{property|}}} Year={{#time:Y|{{{year|}}} }}|}}<!-- store year -->{{#set: {{{property|}}}={{#time:Y|{{{year|}}} }} {{#ifeq: {{{era|CE}}}|BCE|BCE|}}|}}<!-- only year is present given -->}}<!-- if month --><!-- -->{{#set: {{{property|}}} Era={{{era|CE}}}|}}<!-- set the era; CE is default -->{{#set: {{{property|}}} Approximate={{{approximate|No}}}|}}<!-- set approximate; No is default --><!--
-->}}<!-- if year
-->}}<!-- if property
--></includeonly>