Only allow future dates with Fluent Forms

tdrayson

A member wanted a way to only allow users to select dates in the future with the date picker field.

Fluent Forms uses the flatpickr library on the frontend, so we can pass in config parameters to alter the date picker.

Paste the snippet below into the Advanced Date Configuration box under Advanced options in the field settings.

Javascript

        {
    minDate: new Date().fp_incr(1)
}
      
Copy

👋🏻 Weekly Tutorial Digest

I send out a weekly newsletter with links to new tutorials written in the last week, you can subscribe below.

Newsletter

🔒I won't send you spam, I promise