Difference between revisions of "Template:SetDatePropertyValue"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 16: Line 16:
 
  -->{{#if: {{{year|}}}<!--
 
  -->{{#if: {{{year|}}}<!--
 
   -->| store year {{#set: {{{property|}}} Year={{{year|}}}|}}<!-- store year  
 
   -->| store year {{#set: {{{property|}}} Year={{{year|}}}|}}<!-- store year  
  --> check month {{#if: {{{month|}}}<!--
 
    -->| store month {{#set: {{{property|}}} Month={{{month|}}}|}}<!-- store month
 
    --> check day {{#if: {{{day|}}}<!--
 
      -->| store day {{#set: {{{property|}}} Day={{{day|}}}|}}<!-- store day
 
      --> all present {{#vardefine: varDate|{{{day|}}} {{{month|}}} {{{year|}}}}}<!-- all components are present 
 
      -->| month and year present {{#vardefine: varDate|{{{month|}}} {{{year|}}}}}<!-- only month and year are present
 
    -->}}<!-- if day
 
    -->|year present{{#vardefine: varDate|{{{year|}}}}}<!-- only year is present 
 
  -->}}<!-- if month
 
  --><!--
 
  --><!--set the overall date
 
  -->store value {{#set: {{{property|}}}={{#var: varDate}}|}}<!--
 
 
  -->}}<!-- if year
 
  -->}}<!-- if year
 
-->}}<!-- if property
 
-->}}<!-- if property
 
--></includeonly>
 
--></includeonly>

Revision as of 21:23, 23 August 2016

This template is used to set a value of type date given the year, month, and day. Month and day are optional parameters. The template will also store all the parts individually to keep track of which parts of the date are incomplete.

NOTE: As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.

Parameters:

  • |property= - the name of the property.
  • |year= - the year.
  • |month= - the month.
  • |day= - the day.