SPIP
Article validated
The article « |affdate_debut_fin
(https://www.spip.net/en_article6799.html) » was validated by George.
|affdate_debut_fin
Friday 13 January 2023 , by jack
The |affdate_debut_fin
filter displays the time interval between two
dates as text.
Table of contents
- In practice
- Examples
- If the two dates are in different years…
- See also
In practice|Back to the table of contents
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 hide the hours;
-
format (optional): displays format options
- jour: to force the display of the day’s name;
- annee: to force the display of the year;
-
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://en.wikipedia.org/wiki/HCalendar).
Examples|Back to the table of contents
[
(
#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…[|Back to the table of
contents](#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|Back to the table of contents
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)
— Sent by SPIP (https://www.spip.net/)