### [How to Customize the Date Time Field Date Options](https://wpforms.com/developers/customize-the-date-time-field-date-options/)

**Published:** February 26, 2021
**Author:** Umair Majeed

**Excerpt:** This tutorial will give you several different examples on how to customize the Date Picker and Date Dropdown form fields. 

**Content:**

Would you like to customize the date time field date options in WPForms? The **Date / Time** field includes two format options for the date selector: **Date Picker**, which provides the user with a calendar, or **Date Dropdown**.

With the release of version 1.6.3, WPForms gives you options inside the form builder to **Limit Days** and even **Disable Past Dates** as well as **Limit Hours**. If this is all you need to do, [please review this documentation](https://wpforms.com/docs/how-to-limit-options-for-the-date-time-field/ "How to Limit Options for the Date / Time Field").

This tutorial will focus more on customizing the **Date Dropdown** field and calculating dates blocks for the **Date Picker**.

It’s important to remember that if you are using **any** of the code snippets in this doc, the form builder options for limiting should be turned **off**. To find out more about the built-in options for limiting the dates, [please check out this documentation](https://wpforms.com/docs/how-to-limit-options-for-the-date-time-field/#limit-date).

## Creating the form

Before we add any snippets, you’ll need to create your form and add your fields. Since this tutorial is based on the **Date Dropdown** field, you’ll need to add at least one **Date** field.

If you need any assistance in creating your form, [please see this tutorial](https://wpforms.com/docs/creating-first-form/ "How to Customize the Date Time Field Date Options").

Once you’ve added your date fields, make sure you’ve selected the **Type** to **Date Dropdown**. You can set the **Date Type** by clicking into the **Advanced** options of the form field.

![Select the format for the date field to Date Dropdown](https://wpforms.com/wp-content/uploads/2021/02/wpforms-set-date-dropdown.jpg)## Customizing the Date field

In order to customize the **Date** field, you’ll need to add one of the code snippets below to your site.

If you need any help in learning how to add code snippets to your site, [please review this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

Some of the code snippets below will require the use of specific [form ID and field ID](https://wpforms.com/developers/how-to-locate-form-id-and-field-id/ "How to Locate Form ID and Field ID") information.

## Using snippets on the Date Dropdown

#### Limiting the number of days in the dropdown to match the month

In order to have the **Days** field coincide with the amount of days available for that particular month, you’d use this snippet.

```

/**
 * Limit the days dropdown to match how many days are available for the selected month.
 *
 * @link https://wpforms.com/developers/customize-the-date-time-field-date-options/
 */
 
function wpf_dev_days_dropdown_match_month( ) {
?>

**Categories:** Fields

**Tags:** Date Time Field, Javascript, PHP

---

