Support

Account

Home Forums Front-end Issues Date picker hide year for current year, and show it for future years

Solving

Date picker hide year for current year, and show it for future years

  • Hello ! I have a band site, made with elementor PRO and ACF. I use CPT for my events. I’ve already been able to order them in various loops and archives by ACF custom field date and to hide previous ones, with some php snippets.

    Now, I would like to display the year only for future years.
    ex: 2024/03/12 would display “12 march” and 2025/03/12 would display “12 march 2025”

    I am not good enough in php to get it working with found resources on my own. Can you help me ? Thanks !!!

    https://newmoon-pinkfloydexperience.fr/agenda-des-concerts/

  • afterthough : it would be even better if the year is displayed only when then event is more than one year ahead. so 2024/03/12 would display “12 march” and 2025/03/12 would display “12 march 2025” but 2025/01/01 would display “01 January” (without the year since there is no ambiguity)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.