Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days". For full documentation please check the
plugin's site.
Usage
Date Range Picker's CSS and Javascript files are bundled in the global plugin bundles and globally included in all pages:
Date Range Picker's CSS is highly customized in
sass/vendors/plugins/_daterangepicker.scssSCSS file in order to use it as native component within the design system. The SCSS code is compiled into
assets/plugins/global/plugins.bundle.cssand globally included in all pages.
Date Range Picker's Javascript is bundled with
assets/plugins/global/plugins.bundle.jsand globally included in all pages.
Basic Examples
Basic example of Date Range Picker attached to an input element:
<divclass="mb-0"><labelclass="form-label">Basic example</label><inputclass="form-control form-control-solid"placeholder="Pick date rage"id="kt_daterangepicker_1"/></div>
<divclass="mb-0"><labelclass="form-label">Example</label><inputclass="form-control form-control-solid"placeholder="Pick date rage"id="kt_daterangepicker_2"/></div>
$("#kt_daterangepicker_3").daterangepicker({
singleDatePicker:true,
showDropdowns:true,
minYear:1901,
maxYear:parseInt(moment().format("YYYY"),10)},function(start, end, label){var years =moment().diff(start,"years");alert("You are "+ years +" years old!");});
<divclass="mb-0"><labelclass="form-label">Example</label><inputclass="form-control form-control-solid"placeholder="Pick date rage"id="kt_daterangepicker_3"/></div>
Predefined Date Ranges
Enable date range selection from predefined options: