Difference between revisions of "Template:PrettyDate"

From DAS Wiki
(Created page with "{{#ifeq:{{#len:{{{value|}}}}}|4| {{#time:Y|{{{value|}}}}}| {{#if:{{#pos:{{{value|}}}|/}}| {{#time:j/n/y|{{{value|}}}}}| {{#time:F Y|{{{value|}}}}} }}<!--end of i...")
 
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq:{{#len:{{{value|}}}}}|4|
+
<noinclude>
  {{#time:Y|{{{value|}}}}}|
+
This is the PrettyDate template. It converts various date records from a 2021-2-1 format to a February 1, 2021 format.
  {{#if:{{#pos:{{{value|}}}|/}}|
+
</noinclude>
    {{#time:j/n/y|{{{value|}}}}}|
+
<includeonly>
    {{#time:F Y|{{{value|}}}}}
+
{{#ifeq:{{#len:{{{value}}}}}|4
  }}<!--end of if-->
+
        |{{#time:Y|{{{value}}}}} <!-- 4 digits long must mean year only -->
 +
        |{{#ifeq:{{{precision}}}|2
 +
                |2 <!--{{#time:F Y|{{{value}}}}} precision of 2 means Month and Year -->
 +
                    |{{#time:F j, Y|{{{value}}}}} <!-- else full date -->
 +
          }}<!--end of ifeq-->
 
}}<!--end of ifeq-->
 
}}<!--end of ifeq-->
 +
</includeonly>

Latest revision as of 15:50, May 13, 2021

This is the PrettyDate template. It converts various date records from a 2021-2-1 format to a February 1, 2021 format.