DateRangePicker

Dual-calendar date-range selector with range highlighting, optional preset shortcuts, single-day selection, and keyboard support. Two hidden inputs hold the start and end values for form submission.

Basic Range Picker

Click the trigger to open the two-month calendar. Click a start date, then an end date. The same day can be clicked twice for a single-day selection.

Pick a range to see output…

With Preset Shortcuts

Enables the preset panel with common shortcuts: Today, Last 7 days, This month, etc.

Pick a range to see output…

Auto-Apply

The selection closes immediately when the second date is clicked — no Apply button needed.

Pick a range to see output…

Pre-populated with Min/Max Constraints

Days outside the allowed range are greyed out and unselectable.

Single Month

Show a single calendar month instead of two side-by-side. Useful in narrow layouts.

Custom Presets

Supply your own preset labels and date pairs — useful for domain-specific ranges like financial quarters.

Week Starting Monday + With Label

Disabled

PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->daterangepicker($id)stringCreate a DateRangePicker component.
->startValue($date)?stringSet the initial start date (Y-m-d by default).
->endValue($date)?stringSet the initial end date.
->values($start, $end)?string, ?stringSet both start and end values in one call.
->startName($name)stringForm field name for the start hidden input.
->endName($name)stringForm field name for the end hidden input.
->placeholder($text)stringCombined placeholder shown when no range is selected.
->startPlaceholder($text)stringPlaceholder for the start segment. Default: Start date.
->endPlaceholder($text)stringPlaceholder for the end segment. Default: End date.
->min($date)stringEarliest selectable date (Y-m-d).
->max($date)stringLatest selectable date (Y-m-d).
->format($fmt)stringPHP date() format for values. Default: Y-m-d.
->disabled($dis)boolDisable the picker. Default: false.
->highlightToday($hl)boolHighlight today in the calendar. Default: true.
->showPresets($show)boolShow the built-in preset shortcuts sidebar. Default: false.
->presets($arr)arrayCustom preset array (each entry: [label, start, end]). Automatically enables the preset panel.
->weekStartsMonday($mon)boolStart week columns on Monday. Default: false (Sunday).
->singleMonth($single)boolShow one calendar instead of two side-by-side. Default: false.
->autoApply($auto)boolClose and apply immediately when the end date is clicked, skipping the Apply button. Default: false.
->required($req)boolMark the start input as required. Default: false.
->label($text)stringRender a label above the trigger. Inherited from Component.
->labelRequired()Mark the label with a required asterisk.
->labelHint($text)stringAdd hint text to the label.
->labelIcon($fa)stringPrepend a Font Awesome icon to the label.

JS JS Methods

Method / PropertyParametersDescription
m.daterangepicker(id)stringGet DateRangePicker instance (auto-initialized on DOMContentLoaded).
value()Get range as { start, end } strings.
value({ start, end })objectSet both dates programmatically.
start()Get start date string.
start(val)stringSet start date (keeps existing end).
end()Get end date string.
end(val)stringSet end date (keeps existing start).
clear()Clear both dates and emit m:daterangepicker:clear.
min(val)stringUpdate minimum date constraint.
max(val)stringUpdate maximum date constraint.
open()Open the picker panel programmatically.
close()Close the picker panel.
enable()Enable the picker.
disable()Disable the picker.

EVENT Events

Event NameDetailDescription
m:daterangepicker:change{ start: string, end: string }Fired when the Apply button is clicked (or auto-apply fires) with a complete range.
m:daterangepicker:start{ start: string }Fired immediately when the start date is clicked (end not yet selected).
m:daterangepicker:clear{}Fired when the Clear button is clicked.