Support

Account

Home Forums Front-end Issues Format Date Picker in hidden input Gravity Form

Helping

Format Date Picker in hidden input Gravity Form

  • Hi

    I am using ACF Pro to create a custom field called cpt_date on a custom post type Event. This field is a Date Picker.
    In Gravity Form, I created a form to allow people to subscribe to this event. In an input, I get the value of cpt_date of the current event. I want to use it in the confirmation email. My problem is that it displayed the date in the format YYYYMMDD and I would like it to look as I choosed in ACF admin meaning DD-MM-YYYY. How can I change the format of the date in the value of this hidden field?

    Thanks for your help

  • Hi @ac-morcrette

    To get the date format matching the Return Format option, you need to use the get_field() function. If you want, you can also format it manually. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/date-picker/.

    I hope this helps 🙂

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

The topic ‘Format Date Picker in hidden input Gravity Form’ is closed to new replies.