Difference between revisions of "Template:PrintDatePropertyInOnString"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
m (HakobBarseghyan moved page Property:PrintDatePropertyInOnString to Template:PrintDatePropertyInOnString without leaving a redirect)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template is used to return a nicely formatted string of "on 24 August 2016", "in August 2016", or "in 2016" depending on which parts of the date type property are given. The template assumes that the data is previously stored with [[Template:SetDatePropertyValue]].  
+
This template is used to return a nicely formatted string of "on 24 August 2016", "in August 2016", or "in 2016" depending on which parts of the date type property are given. The template assumes that the data has been previously stored with [[Template:SetDatePropertyValue]].  
  
 
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
 
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
Line 7: Line 7:
 
* <code><nowiki>|object=</nowiki></code> - the full page name of the object.
 
* <code><nowiki>|object=</nowiki></code> - the full page name of the object.
 
* <code><nowiki>|property=</nowiki></code> - the name of the property.
 
* <code><nowiki>|property=</nowiki></code> - the name of the property.
* <code><nowiki>|link=</nowiki></code> - determines whether the value is to be printer as a link to the respective page (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
+
* <code><nowiki>|link=</nowiki></code> - determines whether the value is to be printed as a link to the respective page (where available); possible values are ''none'', ''subject'', ''all''. If not given ''all'' is the default.
  
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
Line 13: Line 13:
 
  --><!-- check if the date part is assigned
 
  --><!-- check if the date part is assigned
 
  -->|{{#if: {{#show: {{{object|}}}|?{{{property|}}} Day|link=none}}|on|in}}<!-- "on" if the day is stored on, "in" otherwise  
 
  -->|{{#if: {{#show: {{{object|}}}|?{{{property|}}} Day|link=none}}|on|in}}<!-- "on" if the day is stored on, "in" otherwise  
 +
  -->{{#ifeq: {{#show: {{{object|}}}|?{{{property|}}} Approximate|link=none|}}|Yes|&#32;''circa''|}}<!-- add circa. if necessary
 
   -->&#32;{{#show: {{{object|}}}|?{{{property|}}}|link={{{link|}}}}}<!-- add the date itself
 
   -->&#32;{{#show: {{{object|}}}|?{{{property|}}}|link={{{link|}}}}}<!-- add the date itself
 
-->}}<!-- if property
 
-->}}<!-- if property
 
--></includeonly>
 
--></includeonly>

Latest revision as of 13:09, 30 August 2016

This template is used to return a nicely formatted string of "on 24 August 2016", "in August 2016", or "in 2016" depending on which parts of the date type property are given. The template assumes that the data has been previously stored with Template:SetDatePropertyValue.

NOTE: As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.

Parameters:

  • |object= - the full page name of the object.
  • |property= - the name of the property.
  • |link= - determines whether the value is to be printed as a link to the respective page (where available); possible values are none, subject, all. If not given all is the default.