<html lang="pt-br" dir="ltr"><head></head><body>### [Setting Conditional Time Limits for Specific Dates in a Date/Time Field](https://wpforms.com/developers/setting-conditional-time-limits-for-specific-dates-in-a-date-time-field/)

**Published:** October 26, 2025
**Author:** Umair Majeed

**Content:**

Would you like to limit the available time options in your Date/Time field for specific dates? By default, the Date/Time field in WPForms allows you to set general time ranges using the form builder settings. However, if you need to enforce special time limits for one particular date (for example, shorter pickup hours on a holiday), you can easily do that using a small JavaScript snippet.

In this tutorial, we’ll walk you through the steps to restrict the available time range for one specific date, while keeping general time limits for all other dates.

---

## Creating the Form

First, you’ll need to create your form and add the **Date/Time** field.
If you’d like users to select both date and time separately, make sure the field type is set to **Date / Time** under *Format*.

For example:

- General pickup time: 11:00 AM to 5:00 PM
- Special day (October 4, 2025): 11:00 AM to 2:00 PM

## Adding Conditional Time Limits

Now it’s time to add the snippet to your site.
If you’re not sure where or how to add code snippets, please see [our tutorial on adding custom PHP or JavaScript for WPForms](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/).

```

add_action('wpforms_wp_footer_end',function(){?&gt;

**Categories:** Snippets, Fields

---

</body></html>