|extraire_date

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

  • New in : SPIP 1.4

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".

Author jack Published : Updated : 03/07/23

Translations : English, français, Nederlands