I'm using this date range picker component: http://www.daterangepicker.com/ and by default the widget shows two calendars. I would like to show only one calendar and be able to use the < > buttons to select next/previous months when selecting start and end dates i.e., be able to select a start date in January (showing only January) and then select an end date in March (showing only March), by clicking the > button. There is an option for singleDatePicker: true, but this disables the ability to select a range of dates.
The JavaScript Date Range Picker provides an adaptive and responsive UI appearance for mobile devices. Control all the UI elements and behaviors of the Date Range Picker with a rich set of developer-friendly APIs to provide the best user experience.
Features include selectable date range limit, translatable strings and date formats, single date picker mode, time picker, and preset time ranges. 1. Include the required jQuery library and moment.js on the web page. 2. Include the Daterangepicker plugin’s information. 3. Attach a primary date range picker to the input field. 4.
You can use a hack to enable range selection in just one calendar: To insert just one calendar and works well you have to hidden the second calendar: $ (function () { $ ('input [name="daterange"]').daterangepicker ( { "autoapply": true }); $ ('.drp-calendar.right').hide (); $ ('.drp-calendar.left').addClass ('single'); });
js-cropper is a quick and easy way to add image cropping functionality to your web... Datetimerange Picker is a JavaScript component that is a date and time range picker, no build needed, no dependencies except for Moment.js, which is inspired by Dan Grossman’s boot data picker.
Code to remove second calendar for: http://www.daterangepicker.com Will be able to select a date range within one calendar.
/* REMOVE SECOND CALENDAR */
.daterangepicker .drp-calendar.right {
position: absolute !important;
right: 0 !important;
top: 0 !important;
}
.daterangepicker .drp-calendar.right tbody {
display: none !important;
}
.daterangepicker .drp-calendar.right thead > tr:nth-child(2) {
display: none !important;
}
.daterangepicker .drp-calendar.right th.month {
display: none !important;
}
.daterangepicker .drp-calendar.right .calendar-table {
background: transparent !important;
}
.daterangepicker .daterangepicker.ltr .ranges, .daterangepicker.ltr .drp-calendar {
float: none !important;
}
.daterangepicker .drp-calendar.right .daterangepicker_input {
position: absolute !important;
}
/* REMOVE SECOND CALENDAR */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With