DateRangePicker / Day Span

Blazor Date Range Picker Example

Loading Syncfusion Blazor Server Demos…

This sample demonstrates the day‑span restriction capability of the Blazor DateRangePicker. The picker is configured to accept only ranges that span a minimum of five days and a maximum of ten days, enforcing duration constraints at selection time and preventing invalid submissions.

Configure the behavior using the MinDays and MaxDays properties. When a user attempts a selection outside these bounds the component indicates the invalid range and requires adjustment before the value is committed, ensuring UI-level enforcement of business rules.

This pattern is practical for scenarios such as hotel bookings, equipment rentals, or policy-driven scheduling where minimum and maximum stay or reservation durations must be enforced. Bind the DateRangePicker value to your view model to capture validated ranges, and surface concise, localized feedback explaining why a selection is rejected.

Implementation notes and recommendations:

  • Set MinDays and MaxDays according to business requirements and validate again server-side for security.
  • Provide accessible error messaging and ARIA announcements so screen readers and keyboard users receive clear guidance.
  • Test across cultures and time zones to confirm day counts align with local calendar conventions and daylight‑saving transitions.