Пређи на садржај

Шаблон:Dts

Iz Vojne Enciklopedije
Документација шаблона[прикажи] [уреди] [историја] [освежи]

{{#ifeq:dts |док

    | 

{{#ifeq:show |show

|
        }}{{#if: |
         |   {{#ifexist:Шаблон:Dts
                  | [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
                  | 
                 }}
        }}
    | 
   }}

Dts (date time sorting) is used to correctly sort and display dates in a sortable table (see Help:Sorting).

What it solves

Normally, for proper sorting, dates must be entered in YYYY-MM-DD format. However, that format does not conform to the Manual of Style for date display. This template automatically creates the hidden key for sorting purposes whilst displaying the date in an alternative format (e.g. day-month-year).

Parameters

Dates

The year, month and day can either be entered separately or as a single date.
{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:BC|BC| |BC | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}} {{{{#if:dts|dts| tlf|...}}{{#ifeq:date|date| |date | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}
  • 1st parameter – Year (optional if month is given)
    • Positive number (1 to 999,999,999,999) represent years AD or BC (dependant on the fourth parameter).
    • Negative numbers (−1 to −999,999,999,999) represent years BC (without the fourth parameter).
    • Year numbers must not contain commas or other formatting.
  • 2nd parameter – Month (optional if the day is not given either)
    • Full month name – e.g. February
    • Abbreviated month name – e.g. Feb
    • Month number – (either zero-padded or not) e.g. 2 or 02
  • 3rd parameter – Day (optional)
    • Day number – (either zero-padded or not) e.g. 7 or 07
  • 4th parameter – (optional)
    • May be BC, AD, BCE or CE
    • Used with a positive year number
  • 1st parameter – the full date
    • By default YYYY-MM-DD format becomes month-day-year format while other formats remain in the order they are input.
    • Abbreviated months are accepted and are abbreviated in the output.
    • Capitalisation and comma mistakes are corrected.
    • A single number is interpreted as a year, otherwise the date is parsed by the module. The following formats are accepted:
      • YYYY-MM-DD
      • DD-MM-YYYY
      • DD Month YYYY
      • Month DD, YYYY
      • YYYY-MM
      • DD Month
      • Month DD
      • Month YYYY
      • YYYY
      • Month
    • Day and month numbers may be 1 or 2 digits, and year numbers may only be 3 or 4 digits. If you need to input a number less than 1000, use leading zeroes (e.g. "0700").
    • BC years can only be parsed if the date is only the year number.
    • If you need to include the day or month for BC years or years greater than 9999, you must use separate parameters for year, month and day.


{{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:| {{#if:| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:month|month| |month | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:month year|month year| |month year | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:day month year|day month year| |day month year | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:month day, year|month day, year| |month day, year | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:day month|day month| |day month | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:month day|month day| |month day | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:YYYY-MM-DD|YYYY-MM-DD| |YYYY-MM-DD | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:| {{#if:| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:era|era| |era | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:|| | | }}{{#ifeq:month|month| |month | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}| {{#if:{{{{#if:dts|dts| tlf|...}}{{#ifeq:|| | | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}|
Examples
input style input code hidden sort key visible output
{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1893|||{{{4}}} {{#if: |1893||{{{3}}} {{#if: |1893|{{{2}}} {{#if:1893 |1893
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour 1893
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|-89|||{{{4}}} {{#if: |-89||{{{3}}} {{#if: |-89|{{{2}}} {{#if:-89 |-89
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour 89 p. n. e.
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|-10000|||{{{4}}} {{#if: |-10000||{{{3}}} {{#if: |-10000|{{{2}}} {{#if:-10000 |-10000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour 10.000 p. n. e.
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:month|month| |month | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|октобар|||{{{4}}} {{#if: |октобар||{{{3}}} {{#if: |октобар|{{{2}}} {{#if:октобар |октобар
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'октобар' nije validan datum Greška u šablonu Dts: 'октобар' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:month year|month year| |month year | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|фебруар 1767|||{{{4}}} {{#if: |фебруар 1767||{{{3}}} {{#if: |фебруар 1767|{{{2}}} {{#if:фебруар 1767 |фебруар 1767
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'фебруар 1767' nije validan datum Greška u šablonu Dts: 'фебруар 1767' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:day month year|day month year| |day month year | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|12. август 1987|||{{{4}}} {{#if: |12. август 1987||{{{3}}} {{#if: |12. август 1987|{{{2}}} {{#if:12. август 1987 |12. август 1987
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '12. август 1987' nije validan datum Greška u šablonu Dts: '12. август 1987' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:month day, year|month day, year| |month day, year | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|јул 1, 1867|||{{{4}}} {{#if: |јул 1, 1867||{{{3}}} {{#if: |јул 1, 1867|{{{2}}} {{#if:јул 1, 1867 |јул 1, 1867
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јул 1, 1867' nije validan datum Greška u šablonu Dts: 'јул 1, 1867' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:day month|day month| |day month | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|25. октобар|||{{{4}}} {{#if: |25. октобар||{{{3}}} {{#if: |25. октобар|{{{2}}} {{#if:25. октобар |25. октобар
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '25. октобар' nije validan datum Greška u šablonu Dts: '25. октобар' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:month day|month day| |month day | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|јануар 1|||{{{4}}} {{#if: |јануар 1||{{{3}}} {{#if: |јануар 1|{{{2}}} {{#if:јануар 1 |јануар 1
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јануар 1' nije validan datum Greška u šablonu Dts: 'јануар 1' nije validan datum
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:YYYY-MM-DD|YYYY-MM-DD| |YYYY-MM-DD | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2014-12-09|||{{{4}}} {{#if: |2014-12-09||{{{3}}} {{#if: |2014-12-09|{{{2}}} {{#if:2014-12-09 |2014-12-09
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour decembar 9, 2014
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1990|10||{{{4}}} {{#if: |1990|10|{{{3}}} {{#if:10 |1990|10 {{#if:1990 |1990
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 1990
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1980|децембар||{{{4}}} {{#if: |1980|децембар|{{{3}}} {{#if:децембар |1980|децембар {{#if:1980 |1980
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'децембар' nije validna vrednost za mesec Greška u šablonu Dts: 'децембар' nije validna vrednost za mesec
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1970|август||{{{4}}} {{#if: |1970|август|{{{3}}} {{#if:август |1970|август {{#if:1970 |1970
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'август' nije validna vrednost za mesec Greška u šablonu Dts: 'август' nije validna vrednost za mesec
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2024|јун|12|{{{4}}} {{#if:12 |2024|јун|12 {{#if:јун |2024|јун {{#if:2024 |2024
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јун' nije validna vrednost za mesec Greška u šablonu Dts: 'јун' nije validna vrednost za mesec
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|-204|11|22|{{{4}}} {{#if:22 |-204|11|22 {{#if:11 |-204|11 {{#if:-204 |-204
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour novembar 22, 204 p. n. e.
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq:year|year| |year | }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:era|era| |era | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:BC

|44|3|15|BC {{#if:15 |44|3|15 {{#if:3 |44|3 {{#if:44 |44
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour mart 15, 44 p. n. e.
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:AD

|94|октобар|17|AD {{#if:17 |94|октобар|17 {{#if:октобар |94|октобар {{#if:94 |94
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'октобар' nije validna vrednost za mesec Greška u šablonu Dts: 'октобар' nije validna vrednost za mesec
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq: }}{{#ifeq:month|month| |month | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

||мај||{{{4}}} {{#if: ||мај|{{{3}}} {{#if:мај ||мај {{#if: |
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'мај' nije validna vrednost za mesec Greška u šablonu Dts: 'мај' nije validna vrednost za mesec
}}
{{{{#if:dts|dts| tlf|...}}{{#ifeq: }}{{#ifeq:month|month| |month | }}{{#ifeq:day|day| |day | }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}{{#ifeq:x }}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

||септембар|12|{{{4}}} {{#if:12 ||септембар|12 {{#if:септембар ||септембар {{#if: |
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'септембар' nije validna vrednost za mesec Greška u šablonu Dts: 'септембар' nije validna vrednost za mesec
}}

Formatting

Using format produces a format that depends on, but is not necessarily equal to the format of the supplied date. The format parameter can take nine values.

{{#if: | {{#if:| {{#if:| {{#if:dmy| {{#if:| {{#if:dm| {{#if:| {{#if:mdy| {{#if:| {{#if:md| {{#if:| {{#if:my| {{#if:d| {{#if:m| {{#if:y| {{#if:hide|
Examples
value function input code hidden sort key visible output
 |

}}{{#if:format depends on the input|

format depends on the input|

}}|{{dts{{#if:

|26. јануар 1788|||{{{4}}} {{#if: |26. јануар 1788||{{{3}}} {{#if: |26. јануар 1788|{{{2}}} {{#if:26. јануар 1788 |26. јануар 1788
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '26. јануар 1788' nije validan datum Greška u šablonu Dts: '26. јануар 1788' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|март 12, 1557|||{{{4}}} {{#if: |март 12, 1557||{{{3}}} {{#if: |март 12, 1557|{{{2}}} {{#if:март 12, 1557 |март 12, 1557
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'март 12, 1557' nije validan datum Greška u šablonu Dts: 'март 12, 1557' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1975-02-13|||{{{4}}} {{#if: |1975-02-13||{{{3}}} {{#if: |1975-02-13|{{{2}}} {{#if:1975-02-13 |1975-02-13
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour februar 13, 1975
}}
dmy|

}}{{#if:displays the date in day-month-year format|

displays the date in day-month-year format|

}}|{{dts{{#if:

|септембар 13, 1888|||{{{4}}} {{#if: |септембар 13, 1888||{{{3}}} {{#if: |септембар 13, 1888|{{{2}}} {{#if:септембар 13, 1888 |септембар 13, 1888
         }}
      }}
   }}
}}{{#if:dmy
|format=dmy
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'септембар 13, 1888' nije validan datum Greška u šablonu Dts: 'септембар 13, 1888' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1983-01-03|||{{{4}}} {{#if: |1983-01-03||{{{3}}} {{#if: |1983-01-03|{{{2}}} {{#if:1983-01-03 |1983-01-03
         }}
      }}
   }}
}}{{#if:dmy
|format=dmy
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour 3 januar 1983
}}
dm|

}}{{#if:displays only the day and month in day-month format|

displays only the day and month in day-month format|

}}|{{dts{{#if:

|фебруар 26, 1788|||{{{4}}} {{#if: |фебруар 26, 1788||{{{3}}} {{#if: |фебруар 26, 1788|{{{2}}} {{#if:фебруар 26, 1788 |фебруар 26, 1788
         }}
      }}
   }}
}}{{#if:dm
|format=dm
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'фебруар 26, 1788' nije validan datum Greška u šablonu Dts: 'фебруар 26, 1788' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2020-10-15|||{{{4}}} {{#if: |2020-10-15||{{{3}}} {{#if: |2020-10-15|{{{2}}} {{#if:2020-10-15 |2020-10-15
         }}
      }}
   }}
}}{{#if:dm
|format=dm
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour 15 oktobar
}}
mdy|

}}{{#if:displays the date in month-day-year format|

displays the date in month-day-year format|

}}|{{dts{{#if:

|август 31, 1901|||{{{4}}} {{#if: |август 31, 1901||{{{3}}} {{#if: |август 31, 1901|{{{2}}} {{#if:август 31, 1901 |август 31, 1901
         }}
      }}
   }}
}}{{#if:mdy
|format=mdy
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'август 31, 1901' nije validan datum Greška u šablonu Dts: 'август 31, 1901' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2006-11-08|||{{{4}}} {{#if: |2006-11-08||{{{3}}} {{#if: |2006-11-08|{{{2}}} {{#if:2006-11-08 |2006-11-08
         }}
      }}
   }}
}}{{#if:mdy
|format=mdy
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour novembar 8, 2006
}}
md|

}}{{#if:displays only the day and month in month-day format|

displays only the day and month in month-day format|

}}|{{dts{{#if:

|26. јун 1988|||{{{4}}} {{#if: |26. јун 1988||{{{3}}} {{#if: |26. јун 1988|{{{2}}} {{#if:26. јун 1988 |26. јун 1988
         }}
      }}
   }}
}}{{#if:md
|format=md
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '26. јун 1988' nije validan datum Greška u šablonu Dts: '26. јун 1988' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2002-05-27|||{{{4}}} {{#if: |2002-05-27||{{{3}}} {{#if: |2002-05-27|{{{2}}} {{#if:2002-05-27 |2002-05-27
         }}
      }}
   }}
}}{{#if:md
|format=md
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour maj 27
}}
my|

}}{{#if:displays only the month and year in month-year format|

displays only the month and year in month-year format|

}}|{{dts{{#if:

|16. новембар 1488|||{{{4}}} {{#if: |16. новембар 1488||{{{3}}} {{#if: |16. новембар 1488|{{{2}}} {{#if:16. новембар 1488 |16. новембар 1488
         }}
      }}
   }}
}}{{#if:my
|format=my
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '16. новембар 1488' nije validan datum Greška u šablonu Dts: '16. новембар 1488' nije validan datum
}}
d|

}}{{#if:displays only the day|

displays only the day|

}}|{{dts{{#if:

|6. јул 1666|||{{{4}}} {{#if: |6. јул 1666||{{{3}}} {{#if: |6. јул 1666|{{{2}}} {{#if:6. јул 1666 |6. јул 1666
         }}
      }}
   }}
}}{{#if:d
|format=d
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '6. јул 1666' nije validan datum Greška u šablonu Dts: '6. јул 1666' nije validan datum
}}
m|

}}{{#if:displays only the month|

displays only the month|

}}|{{dts{{#if:

|1980-02-12|||{{{4}}} {{#if: |1980-02-12||{{{3}}} {{#if: |1980-02-12|{{{2}}} {{#if:1980-02-12 |1980-02-12
         }}
      }}
   }}
}}{{#if:m
|format=m
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour februar
}}
y|

}}{{#if:displays only the year|

displays only the year|

}}|{{dts{{#if:

|-26|јануар|18|{{{4}}} {{#if:18 |-26|јануар|18 {{#if:јануар |-26|јануар {{#if:-26 |-26
         }}
      }}
   }}
}}{{#if:y
|format=y
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec
}}
hide|

}}{{#if:hides the date|

hides the date|

}}|{{dts{{#if:

|15. октобар 1800|||{{{4}}} {{#if: |15. октобар 1800||{{{3}}} {{#if: |15. октобар 1800|{{{2}}} {{#if:15. октобар 1800 |15. октобар 1800
         }}
      }}
   }}
}}{{#if:hide
|format=hide
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '15. октобар 1800' nije validan datum Greška u šablonu Dts: '15. октобар 1800' nije validan datum
}}

Abbreviation

There are two ways of abbreviating the month name.

  1. Directly input an abbreviated month name.
  2. Use the abbr=on parameter.
{{#if:none| {{#if:| {{#if:| {{#if:| {{#if:abbreviated input| {{#if:| {{#if:abbr=on| {{#if:| {{#if:| {{#if:|
Examples
abbreviation method input code hidden sort key visible output
none|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000-01-01|||{{{4}}} {{#if: |2000-01-01||{{{3}}} {{#if: |2000-01-01|{{{2}}} {{#if:2000-01-01 |2000-01-01
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour januar 1, 2000
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000|1|1|{{{4}}} {{#if:1 |2000|1|1 {{#if:1 |2000|1 {{#if:2000 |2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour januar 1, 2000
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1. јануар 2000|||{{{4}}} {{#if: |1. јануар 2000||{{{3}}} {{#if: |1. јануар 2000|{{{2}}} {{#if:1. јануар 2000 |1. јануар 2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '1. јануар 2000' nije validan datum Greška u šablonu Dts: '1. јануар 2000' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000|јануар|1|{{{4}}} {{#if:1 |2000|јануар|1 {{#if:јануар |2000|јануар {{#if:2000 |2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec
}}
abbreviated input|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1. јануар 2000|||{{{4}}} {{#if: |1. јануар 2000||{{{3}}} {{#if: |1. јануар 2000|{{{2}}} {{#if:1. јануар 2000 |1. јануар 2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '1. јануар 2000' nije validan datum Greška u šablonu Dts: '1. јануар 2000' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000|јануар|1|{{{4}}} {{#if:1 |2000|јануар|1 {{#if:јануар |2000|јануар {{#if:2000 |2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec
}}
abbr=on|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|1. јануар 2000|||{{{4}}} {{#if: |1. јануар 2000||{{{3}}} {{#if: |1. јануар 2000|{{{2}}} {{#if:1. јануар 2000 |1. јануар 2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:on
|abbr=on
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: '1. јануар 2000' nije validan datum Greška u šablonu Dts: '1. јануар 2000' nije validan datum
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000|јануар|1|{{{4}}} {{#if:1 |2000|јануар|1 {{#if:јануар |2000|јануар {{#if:2000 |2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:on
|abbr=on
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec Greška u šablonu Dts: 'јануар' nije validna vrednost za mesec
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000-01-01|||{{{4}}} {{#if: |2000-01-01||{{{3}}} {{#if: |2000-01-01|{{{2}}} {{#if:2000-01-01 |2000-01-01
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:on
|abbr=on
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour jan 1, 2000
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2000|1|1|{{{4}}} {{#if:1 |2000|1|1 {{#if:1 |2000|1 {{#if:2000 |2000
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:on
|abbr=on
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour jan 1, 2000
}}

Additional sort key

In case two dates in a table are identical they may be ordered using the addkey parameter.

{{#if:| {{#if:| {{#if:| {{#if:| {{#if:| {{#if:| {{#if:|
Examples
input code hidden sort key visible output
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-10|||{{{4}}} {{#if: |2010-10-10||{{{3}}} {{#if: |2010-10-10|{{{2}}} {{#if:2010-10-10 |2010-10-10
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:3
|addkey=3
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 10, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-09|||{{{4}}} {{#if: |2010-10-09||{{{3}}} {{#if: |2010-10-09|{{{2}}} {{#if:2010-10-09 |2010-10-09
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 9, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-10|||{{{4}}} {{#if: |2010-10-10||{{{3}}} {{#if: |2010-10-10|{{{2}}} {{#if:2010-10-10 |2010-10-10
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:1
|addkey=1
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 10, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-10|||{{{4}}} {{#if: |2010-10-10||{{{3}}} {{#if: |2010-10-10|{{{2}}} {{#if:2010-10-10 |2010-10-10
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 10, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-10|||{{{4}}} {{#if: |2010-10-10||{{{3}}} {{#if: |2010-10-10|{{{2}}} {{#if:2010-10-10 |2010-10-10
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:4
|addkey=4
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 10, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-11|||{{{4}}} {{#if: |2010-10-11||{{{3}}} {{#if: |2010-10-11|{{{2}}} {{#if:2010-10-11 |2010-10-11
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:
|addkey=
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 11, 2010
}}
{{{a}}}|

}}{{#if:|

{{{b}}}|

}}|{{dts{{#if:

|2010-10-10|||{{{4}}} {{#if: |2010-10-10||{{{3}}} {{#if: |2010-10-10|{{{2}}} {{#if:2010-10-10 |2010-10-10
         }}
      }}
   }}
}}{{#if:
|format=
}}{{#if:
|abbr=
}}{{#if:2
|addkey=2
}}}}

{{#if:

Шаблон:Dts/testcases/colour oktobar 10, 2010
}}

Wrapping

To turn off the suppression of word wraps, use the nowrap=off parameter.

Notes

Sorting for incomplete dates

Whole months or years
A whole year or month (and year) is sorted according to its first day.
Missing years
If the year is not specified, the date will be sorted as if the year were the current year.
Blank dates
For no date input at all, the maximum possible sort key is used, so the entry will sort last.

Error handling

Entering an invalid date format will (generally) produce an error message (such as the one below, generated by {{dts|35. јун 1900}}).

Greška u šablonu Dts: '35. јун 1900' nije validan datum

Errors are tracked in Category:Dts templates with errors.

Calendar choice

The template is not capable of distinguishing Julian and Gregorian calendar dates. Also, it is not capable of taking a date in one calendar as input and outputting a date in the other calendar. Thus, to insure proper sorting, editors must either use one calendar for all dates, or pick a specific changeover date (for example, deciding that 4 October 1582 is Julian and all later dates are Gregorian); this would be done on an article-by article basis. Editors are also responsible for explaining to the reader whether the visible dates are Julian or Gregorian, if there is any possibility of confusion.

Linking

The template formerly linked dates automatically, with link=off used to suppress linking. In accordance with current guidelines linking of dates is no longer supported and instances of link=off should be removed. Transclusions using the |{{SAFESUBST:#if:link|link=}} parameter are tracked in Category:Dts templates with deprecated parameters.

See also

|(повратни линкови уреди) |90% }}, since on Meta e.g. 09999 9999 induces numeric sort mode, "&" is prefixed to force string sort mode.

  • {{sort}}, sorting by a specified key (also good for complicated numbers, e.g. scientific notation)
  • {{sortname}}, full name sorting (using "last name, first name" as default sort key)
  • {{tts}}, for sorting times in result tables of athletic events (only needed in certain cases - see template documentation)
  • {{mss}}, for sorting times in tables of eclipses
  • {{nts}}, for numbers

{{#ifeq:Dts|sandbox | |

}}