[SPIP] Proposé : |affdate_debut_fin

SPIP

Article proposé

L’article « |affdate_debut_fin
(https://www.spip.net/ecrire/?exec=article&id_article=6799) » est proposé
à la publication depuis le samedi 7 janvier 2023.


|affdate_debut_fin

samedi 7 janvier 2023 , par jack

The |affdate_debut_fin filter displays the time interval between two
dates as text.

Sommaire

  • In practice
  • Examples
  • If the two dates are in different years…
  • See also

In practice|Retour au sommaire

This filter applies to a start date tag (#DATE, #DATE_DEBUT, etc.) and
accepts the three arguments :

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

, horaire, format}


)


]
  1. End date tag. Ex. #DATE_FIN ;
  2. time (optional) : yes by default. Set non to not display the
    hours ;
  3. format (optional) : display format options
    • jour : to force the name of the day to be displayed ;
    • annee : to force the year to be displayed ;
    • abbr : (joker) to display the abbreviated name of the day (Sun.
      instead of Sunday) ;
    • hcal : (joker) to generate a date in the format HCalendar
      (https://fr.wikipedia.org/wiki/HCalendar).

Examples|Retour au sommaire

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

}


)


]

generates the following HTML code :
From 5 March at 8.30 am to 6 April at 5 pm

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

, non}


)


]

generates the following HTML code :
From 5 March to 6 April

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

, oui, jour}


)


]

generates the following HTML code :
From Thursday 5 March at 08:30 to Monday 6 April at 17:00

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

, oui, jour abbr}


)


]

generates the following HTML code :
From Thu 5 March at 08:30 am to Mon 6 April at 5 pm

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

, oui, jour abbr annee}


)


]

generates the following HTML code :
From Thu 5 March at 08:30 am to Mon 6 April 2020 at 5 pm

If the two dates are in different years…[|Retour au

sommaire](#s-If-the-two-dates-are-in-different-years)

…the display will automatically integrate the two years.

[


(


#DATE_DEBUT


|affdate_debut_fin


{

#DATE_FIN

}


)


]

generates the following HTML code :
From 5 March 2020 at 08:30 am to 6 April 2021 at 5 pm

See also|Retour au sommaire

Other variants of affdate :

— Envoyé par SPIP (https://www.spip.net/)


rubon199-7e493.jpg