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}
)
]
- End date tag. Ex. #DATE_FIN ;
-
time (optional) : yes by default. Set non to not display the
hours ; -
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 :
- |affdate (https://www.spip.net/ecrire/?exec=article&id_article=4129)
- |affdate_court
(https://www.spip.net/ecrire/?exec=article&id_article=4130) - |affdate_jourcourt
(https://www.spip.net/ecrire/?exec=article&id_article=4131) - |affdate_mois_annee
(https://www.spip.net/ecrire/?exec=article&id_article=4132)
— Envoyé par SPIP (https://www.spip.net/)