Sablon:Date table sorting

A Wikipédiából, a szabad enciklopédiából
(Sablon:Dts szócikkből átirányítva)
Használati útmutató

Angol Wikipédiából átvett táblázatokhoz! Formátuma: {{dts|év|hónap|nap}}. A német wikiből átvett szövegben rossz a sorrend, fordított sorrendben van!

A Date table sorting a megfelelő dátumrendezéshez és -megjelenítéshez használható rendezhető táblázatban.

Mire megoldás[szerkesztés]

A dátumok bizonyos formátumaikban alfanumerikus karakterláncként kezelve nem megfelelően rendeződnek:

  • Az „1 September 1998” alfanumerikusan az „5 March 1967” előtt jön, mivel 1 kisebb, mint 5.
  • A „February 5, 1922” alfanumerikusan a „January 3, 1922” elé kerülne, mivel az F a J előtt van.

Az ÉÉÉÉ-HH-NN formátum megoldaná e problémát, de ezt nem mindig használják a szócikkekben.

E sablon automatikusan „rejtett kulcsot” ad a dátumokhoz, így helyesen rendeződne, miközben továbbra is az eredeti formátumukban (például February 5, 1922 vagy 5 Feb 1922) jelennek meg.

Paraméterek[szerkesztés]

Dátumok[szerkesztés]

Az év, a hónap és a nap külön vagy egy dátumként is bevihetők.
{{Date table sorting|év|hónap|nap|ie}}(?) {{Date table sorting|dátum}}(?)
  • 1. paraméter – év (opcionális, ha meg van adva a nap)
    • Pozitív egészek (1–999 999 999 999) a 4. paramétertől függően az időszámításunk szerinti vagy előtti éveket jelentenek.
    • Negatív egészek (−1 - -999999999999) a 4. paraméter nélkül is az időszámításunk előtti éveket jelentenek.
    • Az évszámokba nem kell vessző vagy más formázás.
  • 2. paraméter – hónap (opcionális, ha a nap sincs megadva)
    • Teljes hónapnév – pl. February
    • Rövid hónapnév – pl. Feb
    • Hónapsorszám (0-val vagy anélkül) – pl. 2 vagy 02
  • 3. paraméter – Nap (opcionális)
    • Napsorszám (0-val vagy anélkül) – pl. 7 vagy 07
  • 4. paraméter (opcionális)
    • Értéke BC, AD, BCE vagy CE
    • Pozitív évszámmal használatos
  • 1. paraméter – teljes dátum
    • Alapértelmezés szerint év.hónap.nap formátumban jelenik meg.
    • Rövidített hónapnevek elfogadottak és rövidítéssel jelennek meg.
    • A nagybetű- és vesszőhibák kijavíttatnak.
    • Egyetlen szám évként kezeltetik, különben a dátumot a modul kezeli. Az alábbi formátumok érvényesek:
      • ÉÉÉÉ-HH-NN
      • NN-HH-ÉÉÉÉ
      • NN hónap ÉÉÉÉ
      • Hónap NN, ÉÉÉÉ
      • ÉÉÉÉ-HH
      • NN Hónap
      • Hónap NN
      • Hónap ÉÉÉÉ
      • ÉÉÉÉ
      • Hónap
    • A hónap- és napszámok 1 vagy 2, az évszámok csak 3 vagy 4 számjegyűek lehetnek. 1000-nél kisebb szám esetén 0 jelenik meg az év előtt (pl. „0700”).
    • Időszámításunk előtti évek csak akkor adhatók meg, ha csak évszám van a sablonban.
    • A hónap vagy a nap hozzáadásához időszámításunk előtti vagy 9999 feletti éveknél önálló paraméterek adandók meg az évre, a hónapra és a napra.

Formázás[szerkesztés]

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.

Abbreviation[szerkesztés]

There are two ways of abbreviating the month name.

  1. Directly input an abbreviated month name.
  2. Use the abbr=on parameter. It can be placed before or after the date in the template. This allows one to abbreviate the month later if the table becomes too wide. It is easy to use find-and-replace in a text editor, or the wikitext editor, to replace {{Date table sorting| with {{Date table sorting|abbr=on|

Additional sort key[szerkesztés]

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

Wrapping[szerkesztés]

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

TemplateData[szerkesztés]

Date table sorting is used to correctly sort and display dates in a sortable table.

Sablonparaméterek[TemplateData szerkesztése]

ParaméterLeírásTípusÁllapot
Full date or year1

Full date if second to fourth parameters are not specfied, otherwise year. Full date can be either in "YYYY-MM-DD", "DD-MM-YYYY", "DD Month YYYY", "Month DD, YYYY", "YYYY-MM", "DD Month", "Month DD", "Month YYYY" or "Month" format. Year is either a positive number or a negative number. If fourth parameter is not specified negative numbers are interpreted as years of BC era. Parameter is optional if the second parameter is specified.

Példa
"1893", "-89", "-10000", "Oct", "February 1767", "12 Aug 1987", "July 1, 1867", "25 October", "Jan 1", "2014-12-09"
Karakterlánckötelező
Month2

Full or abbreviated month name or alternatively, a month number which can be zero-padded. Parameter is optional if the third parameter is not specified.

Példa
February, Feb, 2 or 02
Karakterláncopcionális
Day3

Day, optionally zero-padded

Példa
7 or 07
Számopcionális
Era4

BC, AD, BCE or CE. Takes effect only if the first parameter is a positive number.

Karakterláncopcionális
Formatformat

Controls the output format. Can be "dmy", "dm", "mdy", "md", "my", "d", "m", "y" or "hide".

Karakterláncopcionális
Abbreviationabbr

Abbreviates the month name

Alap­értelmezett
off
Példa
on
Karakterláncopcionális
Additional sort keyaddkey

Adds another sort key to resolve conflicts between rows with the same date

Példa
3
Számopcionális
Wrappingnowrap

To turn off the suppression of word wraps, use the "off" parameter

Alap­értelmezett
off
Példa
off
Logikaiopcionális

Notes[szerkesztés]

Sorting for incomplete dates[szerkesztés]

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.

Hibák[szerkesztés]

A hibák a Kategória:Hibásan használt date table sorting-sablon kategóriával követhetők.

Calendar choice[szerkesztés]

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[szerkesztés]

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.

Lásd még[szerkesztés]

  • {{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)
  • {{Number table sorting}}, for numbers