Difference between revisions of "Template:Header/year"

From En JW United
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
       |<!-- NO IT IS NOT A NUMBER: more if statements and switches to select the right thing.
 
       |<!-- NO IT IS NOT A NUMBER: more if statements and switches to select the right thing.
  
          First, add temporary tracking category (unless nocat is true) -->{{#ifeq:{{{nocat|}}}|1||[[Category:Works with non-numeric dates]]}}<!--
+
 
  
 
           Now some checks to determine the type on non-numeric input:
 
           Now some checks to determine the type on non-numeric input:
Line 28: Line 28:
 
             -->{{#ifeq:{{{year|{{{1|}}}}}}|unknown
 
             -->{{#ifeq:{{{year|{{{1|}}}}}}|unknown
 
                 |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 
                 |{{#ifeq:{{{noprint|}}}|1||&nbsp;(unknown)&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:Works of unknown date‎]]}}
 +
                |<!--ELSE check if the input is a decade
 +
 +
              -->{{#ifeq:{{is decade|{{{year|{{{1|}}}}}}|function=3}}|1
 +
                    |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]][[Category:Works of uncertain date]]}}
 +
                    |<!--ELSE check if the input is a century
 +
 +
                  -->{{#ifeq:{{is century|{{{year|{{{1|}}}}}}|function=3}}|1
 +
                      |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]][[Category:Works of uncertain date]]}}
 +
                      |<!--ELSE check if the input is Before Common Era (BCE)
 +
 +
                    -->{{#ifeq:{{is year|{{{year|{{{1|}}}}}}|function=3}}|1
 +
                        |{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{{year|{{{1|}}}}}} works]]}}
 +
                        |<!--ELSE check more complicated 2-part inputs
 +
 +
                      -->{{#if:{{#titleparts:{{{year|{{{1|}}}}}}|1|2}}<!-- if there is a 2nd part to the input, separated by a slash
 +
                        -->|{{#switch:{{lc:{{#titleparts:{{{year|{{{1|}}}}}}|1|1}}}}<!-- check the 1st part -->
 +
                              | c
 +
                              | c.
 +
                              | circa = <!-- year entered as "circa/YYYY"
 +
 +
                                      -->{{#ifeq:{{Is year
 +
                                                  | input    = {{#titleparts:{{{year|{{{1|}}}}}}|1|2}}
 +
                                                  | function = 3
 +
                                                }}
 +
                                          |1
 +
                                          |{{#ifeq:{{{noprint|}}}|1||&nbsp;(c. {{#titleparts:{{{year|{{{1|}}}}}}|1|2}})&nbsp;}}{{#ifeq:{{{nocat|}}}|1||[[Category:{{is year|input={{#titleparts:{{{year|{{{1|}}}}}}|1|2}}|function=1}} works]][[Category:Works of uncertain date]]}}<!-- ie. use the corresponding decade-based category for sorting this work with a "circa"-style date -->
 +
                                          |<!-- ELSE
 +
 +
                                        -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}<!-- a "circa"-style date with a non-year 2nd part get categorised as unrecognised and undated -->
 +
                                        }}<!-- end ifeq isyear titleparts (2nd part) -->
 +
                              | #default = <!-- ELSE
 +
 +
                                        -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}<!-- if a multi-part date but no matches, categorise as unrecognised and undated -->
 +
                            }}<!-- end switch titleparts (1st part) -->
 +
                            |<!-- ELSE
  
             
+
                          -->{{#ifeq:{{{noprint|}}}|1||&nbsp;({{{year|{{{1|}}}}}})&nbsp;}}<!-- if the input is STILL not recognised, categorise it as unrecognised and undated -->
 +
                          }}<!-- end if titleparts -->
 +
                      }}<!-- end ifeq year BCE -->
 +
                    }}<!-- end ifeq century -->
 +
                  }}<!-- end ifeq decade -->
 
               }}<!-- end ifeq "unknown" -->
 
               }}<!-- end ifeq "unknown" -->
 
             }}<!-- end ifeq ? -->
 
             }}<!-- end ifeq ? -->

Latest revision as of 12:29, 4 August 2019