[SPIP] PUBLISHED : |extraire_date

SPIP

Article validated

The article « |extraire_date (https://www.spip.net/en_article6611.html) »
was validated by George.


|extraire_date

Friday 2 September 2022 , by jack

The filter |extraire_date extracts the first date encountered in the
tag to which it applies.

The filter |extraire_date extracts a date from any tag containing a
date in the form YYYY-MM or YYYY-MM-DD. If your tag contains several dates
in one of these forms the filter will only extract the first date
encountered.

An example:
In your #DESCRIPTIF, you have

«In 2012-03, various discussions have been launched on the future of the
squirrel and its post-winter exit".

With [(#DESCRIPTIF|extraire_date)], SPIP will display «2012-03-01».
The filter will add « -01 » to the date to be in YYYY-MM-DD format.

Warning: if your #DESCRIPTIF contains a date in the form YYYY-MM-DD
as in:

«On 2012-03-25, a great discussion came to a climax following an
insignificant but pertinent remark,»

the filter will replace « 25 » with « 01 » and display « 2012-03-01 ».

— Sent by SPIP (https://www.spip.net/)

rubon199-7e493.jpg