Content · Web Development · HTML

HTML Date Input: Min and Max Across Month Boundaries

Date Input: Min and Max Across Month Boundaries: The permitted date range crosses from November into December without any special month-handling code. Includes a practical HTML example and an explanation.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

A form should feel easy to use. The visitor sees a question, gives an answer, and needs to know what will happen next.

What You Need to Know


The permitted date range crosses from November into December without any special month-handling code.

Try the Example


Take a look at the example. We’ll explain the important lines right below it.

<form action="/booking" method="get">
    <label for="visit-date">Visit date</label>
    <input id="visit-date" name="visit-date" type="date" min="2026-11-28" max="2026-12-03" required>
    <button type="submit">Choose date</button>
</form>

Let’s Read the Code


  • max: Max sets the largest permitted value where that input type supports it.
  • min: Min sets the smallest permitted value where that input type supports it.
  • <form>: The form groups controls and identifies where submitted data goes.
  • <label>: The label tells people what the input is for. A matching for/id pair makes the label clickable.

Read the named elements and attributes together. They explain how the browser connects this feature to the rest of the page.

What Happens in the Browser?


The HTML controls work in the browser, but saving an answer requires the example action path to be handled by a real server.

Look at the submitted value. The picker may display a friendly calendar or local clock, while form values use specific machine-readable formats. A local date and time does not automatically carry a time-zone identifier. Compare what you see with what your application receives.

Your Turn


Test a date inside the range and one just outside it.

Common Beginner Mistakes


  • Copying the example without giving the fields a clear label and a usable name.
  • Use YYYY-MM-DD for attribute values even if the picker shows a localized date format.

Key Takeaways


  • A control needs a clear label and, when submitted, a meaningful name and value.
  • max: Max sets the largest permitted value where that input type supports it.
  • Remember that HTML form rules help the visitor, but server-side code must decide whether received data is valid.
Share this resourceSend this page to someone who may find it useful.