Date Tags

Date Tags are supported in HTML5 and later; if clicked, the date input type displays a date-picker in modern browsers.

You can use either the date or date* (required) Date Tags.

Note: HTML5 specifications require that the date format be in “YYYY-MM-DD” format, so if you add a value to a Date Tag, it, too, must be in that format.

Options

  • id:id – adds an id attribute to the date tag
  • class:class – adds a class attribute to the date tag
  • min:date – sets the min attribute of the date tag. Relative date formats can be used. For example, “min:today-2weeks” or “min:today+7days” are acceptable values.
  • max:date – sets the max attribute of the date tag. Relative date formats can be used. For example, “max:today-2weeks” or “max:today+7days” are acceptable values.
  • step:number – adds the step attribute of the date tag. When the minimum date is 2018-01-01 and the step is set to 7, the user can input 2018-01-08, 2018-01-15, etc.
  • placeholder – adds Placeholder Text to the tag

Formatting the Date Tag On the Mail Tab

Since the default HTML5 format for the date field, “YYYY-MM-DD,” may not suit your needs, you can set the desired format for the date you see in the email sent when the contact form is submitted.

To re-format the date, you add a Mail Tag in the following syntax:

[_format_(tag name) "(date format)"]

Simply replace “(tag name)” with the name of the date tag from the Form Tab, and “(date format)” with the appropriate date format using the formats used with the PHP date() function.

For example, if you have a Date Tag named, “my-date,” and you want to format the date in your email as “03-12-2018,” with leading zeros for the month and day, you would add a Mail Tag on the Mail Tab of the Edit Contact Form page like the following:

[_format_my-date "m-d-Y"]