Problème de condition de de date

Je souhaite trier, sur ma page de webinaires, deux sections distinctes :

  • une section avec les webinaires déjà passés depuis moins de trois mois,
  • et une autre avec les webinaires passés depuis plus de trois mois mais moins d’un an.

Je me base sur la global date ainsi que sur la date de mon webinaire, qui est un champ ACF. J’applique cette condition pour le premier cas dans l’élément datetime :

{{dc:global:date}} after {{dc:acf:post_field field=“date_de_debut_du_webinaire”}} and
{{dc:global:date}} after {{dc:date:generic date="- 3 months" format=“m-d-Y”}}

Et celle-ci pour le deuxième cas dans l’élément datetime :

{{dc:global:date}} after {{dc:date:generic date="- 1 year" format=“m-d-Y”}} and
{{dc:global:date}} before {{dc:date:generic date="- 3 months"}} and
{{dc:global:date}} after {{dc:acf:post_field field=“date_de_debut_du_webinaire”}}

Mais cela ne fonctionne pas.
Pouvez-vous m’aider ?

Hi @deciplex,

While comparing dates , both values must use the same format , otherwise the comparison will fail. In your conditions, it’s clear that the values are in the m-d-Y format. Please double-check your Global Date format. You can verify it under Settings > General > Date Format , as shown in the screenshot.

You can also match the format directly by using: {{dc:global:date format="m-d-Y"}}

If you have already done this and it is still not working on your end, we will need to investigate it further. In that case, please provide your login credentials in a Secure Note , including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a Secure Note, click the key icon underneath any of your posts.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.