1. Home
  2. Filters
  3. Filter reference: wpforms_datetime_date_formats

apply_filters( 'wpforms_datetime_date_formats', $date_formats )

Filters the date field formats available for the Date Picker in the form builder.

Description

The wpforms_datetime_date_formats filter is applied to an array containing format options for date fields. These options are provided within the form builder when using the Date Picker option.

This filter can be used to add additional format options. The format will determine how date field selections are displayed to the user, how dates appear in entries and notifications, and also how date field selections appear within the database.

Default date format options include:

  • m/d/Y: 01/31/2019
  • d/m/Y: 31/01/2019
  • F j, Y: January 31, 2019

Parameters

$date_formats
(array) (Required) Date format options.

Source

wpforms/pro/includes/fields/class-date-time.php

More Information

Below explains what is contained in the array and the context of how it is used.

$date_formats = apply_filters( 'wpforms_datetime_date_formats', array(
	'm/d/Y'  => 'm/d/Y',
	'd/m/Y'  => 'd/m/Y',
	'F j, Y' => 'F j, Y',
) );

Please see the PHP date reference for additional format options.

Updated on November 15, 2018

Was this article helpful?