Modules / Forms

Form: time-only picker and date limits

Turn the Form element's date field into a booking field: a date range with minimum and maximum nights, blocked dates, a check-out that can't come before the check-in, a calendar shown on the page, the first day of the week and the calendar's colors. There is also a time-only picker, an earliest and latest date, disabled weekdays and a minute step. The calendar greys out the days the rules don't allow, and Kiln checks the rules again when the visitor submits the form. Kiln checks minimum and maximum nights, and ranges that cross a blocked day, only then.

#12 of 39 modules by votes

  • On by default
  • Needs Bricks 2.4 or newer
  • Tested with Bricks 2.4.3
Recording: someone types three booked dates into a form date field, turns on Date range with a two-night minimum and shows the calendar on the page; on the live page the calendar greys out those days, and a visitor picks a stay from October 21 to 24.Recorded in Bricks 2.4.3

How to use it

  1. In the Form element, open a field whose type is the date picker.
  2. For a time field, tick Time only, no calendar (Kiln). The picker shows a clock and no calendar.
  3. To limit the dates, fill in Earliest date and Latest date. Write today, a number of days from today such as +2 or +90, or a date such as 2026-12-24. A negative number such as -3 counts days before today.
  4. To block days of the week, choose them in Disabled weekdays.
  5. To limit the minutes, set Minute step, from 1 to 60. A step of 15 allows :00, :15, :30 and :45.
  6. Optional: write your own text in Date not allowed message. The default is "Please choose an available date."

For bookings

  1. Blocked dates: holidays or booked days, as YYYY-MM-DD, separated by commas or new lines. Dynamic data works, such as a custom field that lists booked days. Kiln reads up to 1,000 dates.
  2. Date range (start and end): one field takes two dates, such as check-in and check-out. Set Minimum nights and Maximum nights if you need them; Kiln checks them when the visitor sends the form and shows your Date not allowed message. A range can't cross a blocked day or a disabled weekday; Kiln checks that when the form is sent, not in the calendar. Picking the same day twice is a same-day booking (0 nights).
  3. Not before field: with two separate date fields, write the field ID of the check-in in the check-out field. Once a visitor picks a check-in, the check-out calendar starts there.
  4. Show the calendar on the page: the calendar stays open under the field instead of opening on click.
  5. Week starts on: Monday, Sunday or Saturday. Left empty, the calendar keeps its own default (Sunday in English, or the start of the week in the picker's language).
  6. Under Calendar, set the colors of the selected day and its text, the ring around today, the hover color, unavailable days, the header and its text, and the corner radius.

Kiln ignores anything else typed in the date fields.

Where it appears in Bricks

Form element, Content tab, inside each field of the Fields list, after Max. time. The controls show when the field is a date picker. The date options and the calendar colors are hidden while Time only, no calendar (Kiln) is ticked.

How it works with your own settings

Bricks' Min. time and Max. time still apply, including in a time-only field. Once a field has a Kiln rule (time only, a date limit, a weekday, a blocked date, a minute step, a range or a linked field), the server also checks that field's Min. time and Max. time.

Disabled weekdays are added to the rules the picker already has. A holiday list you set through Bricks' date picker filter keeps working.

Relative dates count from today in the site's timezone, set in WordPress under Settings > General. The picker works them out in the visitor's browser, so a cached page never shows yesterday's limit.

In a time-only field the picker follows the site's time format: 24-hour when the format uses H or G, otherwise 12-hour with AM and PM.

Limits

  • Date limits and disabled weekdays apply in the picker on the front end. The script that applies them does not load in the builder.
  • The server checks the submitted text against the limits, the weekdays, the minute step and the time range. An empty value is skipped, because Required is Bricks' job.
  • When the picker is translated and the date format prints month or weekday names, the server cannot read the value back. The same holds for a date format with a token the server cannot read. In both cases the picker alone enforces the limits.
  • The minute step counts within each hour. It is checked on the server only for time-only fields and for date pickers with time enabled.
  • A range is sent as two dates joined by " – ". Bricks' option to fill the field from a custom field reads a single date, so it doesn't fill a range. Don't use a range with a site date format that itself contains " – ".
  • Blocked dates that come from dynamic data are read for the post the form belongs to: the page or post it sits on, the item of a post query loop, or the popup's post. It is the post Bricks fills the form's actions with (the email, a new post, a webhook), so the server checks the dates of the post being booked. In a term, user or ACF row loop, the page's post stands in, as it does for Bricks' dynamic data there. Kiln never reads a draft, private or password-protected post, and refuses the date if a submission names one. With no post, Kiln reads the tag without one: a tag for a site-wide value, such as an options page field, still works.
  • On a translated site whose date format spells out month names (such as "F j, Y"), the server can't read the date back, so only the calendar applies blocked dates, ranges and linked fields, and minimum and maximum nights aren't checked. For booking fields, a numeric date format such as d/m/Y lets the server check them.
  • The calendar colors apply to each field's own calendar. In a form that loads later with AJAX (a popup, for example), they come with Bricks' styles for that content.

Settings

None. Turn the module on in Bricks > Kiln (it is on by default).

Requirements

Bricks 2.4 or newer.