Skip to content

Conversation

@Eventpicker
Copy link

i had a problem specifically on mobile applications. the date picker with 2 months displayed went over the whole screen and was difficult to use. so i introduced a new parameter that only works with datepicker. 'showTwoMonth' is a boolean and is true by default. you can set it to false and only 1 month will be displayed.

if timepicker is activated this parameter has no effect

enable/disable if one or two month are displayed at custom daterangepicker
'showTwoMonth' should only be allowed for datePicker
@mikeluyties
Copy link

This is a great addition. I also have this issue on mobile and want to limit it to a single calendar, but still with the date range functionality.

hides all predefined ranges when the user selects custom range button
default: false
Bug Fix: hideRangeWhenCustomFocus was not made at initialization
@kadekdodikwirawan
Copy link

I was able to create a single calendar while still keeping the date range functionality by adding: linkedCalendars: false

new DateRangePicker(dateRangePicker, {
    startDate: new Date(),
    endDate: new Date(),
    parentEl: dateRangePicker.parentNode,
    linkedCalendars: false
});

And in the SCSS:

.daterangepicker {
    .drp-calendar.right {
        display: none !important;
    }
}

@Eventpicker
Copy link
Author

Eventpicker commented Mar 12, 2025

The problem with your solution is that you lose the “next” button.
The "next" button is displayed with the “showTwoMonth” parameter when this is set to true or false.

Adding the 'before.show.daterangepicker' Trigger to change params like 'minDate' before rendering the calendar elements
@kadekdodikwirawan
Copy link

The problem with your solution is that you lose the “next” button. The "next" button is displayed with the “showTwoMonth” parameter when this is set to true or false.

The next button is still apear, just make sure to set linkedCalendars: false
image

@Eventpicker
Copy link
Author

Eventpicker commented Mar 18, 2025

Yes, that's true, sorry about that.

Your solution also works!
But I prefer a solution where I can continue using the other functions.
The feature linkedCalendars: true has been lost as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants