Modèle:Date : Différence entre versions

De Wiklou, le Wiki du Biclou
Aller à : navigation, rechercher
m (1 version)
(+ trim_year)
Ligne 1 : Ligne 1 :
<noinclude>{{modèle protégé}}
+
{{#invoke:Date|Date
<!--==============================================================
+
|year      = {{{year|{{{1|}}}}}}
 
+
|month    = {{{month|{{{2|}}}}}}
          ATTENTION : LA MODIFICATION D'UNE INFOBOX PEUT ENTRAÎNER DES PROBLÈMES
+
|day      = {{{day|{{{3|}}}}}}
        SUR TOUTES LES PAGES DANS LESQUELLES ELLE EST INCLUSE.
+
|hour      = {{{hour|}}}
 
+
|minute    = {{{minute|}}}
Veuillez ne pas tenter de le modifier à moins que vous ne soyez certain de bien comprendre sa conception.
+
|second    = {{{second|}}}
D'autre part, le présent modèle ayant fait l'objet d'un consensus, l'ajout ou la suppression de champs doivent
+
  |class    = {{{class|dtstart}}}
être préalablement discutés sur la page consacrée.
+
|lang      = {{#if:{{{lang|{{{4|}}}}}} | {{{lang|{{{4|}}}}}} | {{int:Lang}} }}
 
+
|case      = {{{case|{{{form|}}}}}}
==============================================================-->
+
|trim_year = {{{trim_year|{{{trim year|100-999}}}}}}
</noinclude><includeonly><!--
+
}}<noinclude>
NOTE. Le modèle est codé de manière à toujours réduire le nombre d'appels à {{#ifexist:}} au minimum possible (1 à 3 appels, suivant les cas)
+
{{documentation}}
(Voir [[Catégorie:Page avec trop d'appels dispendieux de fonctions parseurs]])
 
-->{{#if: {{{1|}}} |<!--
 
  -->[[<!--
 
    -->{{{1}}}{{#ifeq:{{{1}}}|1|er}} {{{2}}} {{#if:{{{4|}}} | {{#ifexist: {{{1}}}{{#ifeq:{{{1}}}|1|er}} {{{2}}} {{{4}}} | {{{4}}} }} }}<!--
 
  -->|{{#switch: {{{1}}} | 1 | 1er= {{Abréviation|1{{exp|er}}|Premier}}  | #default= {{{1}}} }}]]&nbsp;<!--
 
-->}}<!--
 
-->[[<!--
 
  -->{{#if: {{#if:{{{4|}}} | {{#ifexist: {{{2}}} {{{3}}} {{{4}}} | OUI }} }}<!--
 
  -->| {{{2}}} {{{3}}} {{{4}}}<!--
 
  -->| {{#ifexist: {{{2}}} {{{3}}} | {{{2}}} {{{3}}} | {{{2}}} {{#ifeq:{{lc:{{{2}}}}}|mars|(mois)}} }}<!--
 
  -->}}<!--
 
-->|{{{2}}}]]&nbsp;<!--
 
-->[[<!--
 
  -->{{#if:{{{4|}}} | {{#ifexist:{{{3}}} {{{4}}} | {{{3}}} {{{4}}} | {{{3}}} }} | {{{3}}} {{#ifeq:{{lc:{{{3}}}}}|mars|(mois)}} }}<!--
 
-->|{{{3}}}]]<!--
 
--></includeonly><noinclude>
 
{{/Documentation}}<!-- Métadonnées (catégories, etc.) en sous-page de documentation -->
 
 
</noinclude>
 
</noinclude>

Version du 14 juillet 2014 à 20:20

Documentation icon Template documentation[view] [edit] [history] [purge]

This template is used to show a date in the language set in the preferences.

You can leave out parts of the data.

Usage

{{Date |month= |day= |year= |hour= |minute= |second= }}

Examples:

Microformat

The template returns the date, embed in a <time> element with attribute datetime that contain the date in the ISO 8601 format needed by the hCalendar (class="dtstart") microformat. See the microformats project.

⧼templatedata-doc-params⧽

ParameterDescriptionDefaultStatus
month
2
monthmonthemptyoptional
day
3
daydayemptyoptional
lang
4
languagelanguagelanguage code of the user languageoptional
casecasecaseemptyoptional
year
1
yearyearemptyoptional
hourhourhouremptyoptional
classclassclassdtstartoptional
minuteminuteminuteemptyoptional
secondsecondsecondemptyoptional
trim_year
trim year
trim yeartrim or pad the leading zeros in year number100-999optional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Relies on:
Module:Date

⧼Seealso⧽

{{ISOdate}} – Template used to parse the date in {{information}}
{{other date}} - Allows to specify a range of non-trivial date notations in a format that is localizable

Localize the date format at Module:I18n/date or request assistance at Template talk:Date or Module talk:I18n/date