Difference between revisions of "Template:PostedDate"

From ChoralWiki
Jump to navigation Jump to search
(add code to categorize in "Posted in <month> <yyyy>" (with a view to removing categorization in "Posted in <month>" (which does not empty from previous years' postings in <month>))
Line 1: Line 1:
<includeonly>{{#ifexpr:{{#time:Ymd|now-90 days}}>{{#time:Ymd|{{{1|}}}}}|[[Category:More than 90 days old| {{{1|}}}]]}}{{#ifexpr:{{#time:Ymd|now-31 days}}<{{#time:Ymd|{{{1|}}}}}|{{filepath:NewScore.gif}}&nbsp;[[Category:Posted in {{#time:F|{{{1|}}}}}]]<span style="display:none">[[Posted on {{{1|an unknown date}}}]]</span>|[[Category:More than 30 days old| {{{1|}}}]]}}<small>(Posted {{{1}}})</small>&nbsp;</includeonly><noinclude>
+
<includeonly>{{#ifexpr:{{#time:Ymd|now-90 days}}>{{#time:Ymd|{{{1|}}}}}|[[Category:More than 90 days old| {{{1|}}}]]}}{{#ifexpr:{{#time:Ymd|now-31 days}}<{{#time:Ymd|{{{1|}}}}}|{{filepath:NewScore.gif}}&nbsp;[[Category:Posted in {{#time:F|{{{1|}}}}}]][[Category:Posted in {{#time:F yy|{{{1|}}}}}]]<span style="display:none">[[Posted on {{{1|an unknown date}}}]]</span>|[[Category:More than 30 days old| {{{1|}}}]]}}<small>(Posted {{{1}}})</small>&nbsp;</includeonly><noinclude>
 
{{DisplayBox|title=Documentation|text=
 
{{DisplayBox|title=Documentation|text=
 
;Usage: {{tl|PostedDate|''<yyyy-mm-dd>''}}
 
;Usage: {{tl|PostedDate|''<yyyy-mm-dd>''}}
Line 7: Line 7:
 
If the date in the first parameter is more than 90 days old, the page is added to the category "More than 90 days old".  
 
If the date in the first parameter is more than 90 days old, the page is added to the category "More than 90 days old".  
  
If the date in the first parameter is within 30 days of the current date, this template displays the "New" icon and adds the page to the category ''Posted in <month>’’.  
+
If the date in the first parameter is within 30 days of the current date, this template displays the "New" icon and adds the page to the category ''Posted in <month>’’ and in ''Posted in <month> <yyyy>’’.  
  
 
Regardless of the date, this template also prints "(Posted {''<yyyy-mm-dd>'')&nbsp;" before the CPDL number of an edition.
 
Regardless of the date, this template also prints "(Posted {''<yyyy-mm-dd>'')&nbsp;" before the CPDL number of an edition.

Revision as of 02:51, 4 August 2020


Documentation
Usage
{{PostedDate|<yyyy-mm-dd>}}

This template is automatically added to any new edition, if the AddWork form is used.

If the date in the first parameter is more than 90 days old, the page is added to the category "More than 90 days old".

If the date in the first parameter is within 30 days of the current date, this template displays the "New" icon and adds the page to the category Posted in <month>’’ and in Posted in <month> <yyyy>’’.

Regardless of the date, this template also prints "(Posted {<yyyy-mm-dd>) " before the CPDL number of an edition.