3

Is there any way to hide the dates in between the two months when the option of numberOfMonths: 2.

I meant the first month's previous days and second month's next days to be enable and the days in between the two months will be hide.

Expected output will be looks like below:

The red colored part to be hide

Red colored part to be hide

Update: Those [Feb 23-28 and May 1-10] need to be grayed out only.

I want to hide the [Apr 1-5] in the March and [Mar 30-31] in the April.

Sample JsFiddle

3
  • What about the dates grayed out at the beginning of March (Feb 23-28) and end of April (May 1-10)? Commented Mar 4, 2015 at 15:52
  • @j08691: Those [Feb 23-28 and May 1-10] need to grayed out only. I want to hide the [Apr 1-5] in the March and [Mar 30-31] in the April Commented Mar 4, 2015 at 15:55
  • From what I remember, aren't those dates that are colored red selectable? So if they are in March, they should be able to click on April 2, and it should provide that date. Commented Mar 4, 2015 at 15:55

1 Answer 1

3

This one was giving me a hard time but I think you can do it with some CSS:

div.ui-datepicker-group-first td:not(.ui-datepicker-other-month) ~ td.ui-datepicker-other-month {
    visibility:hidden;
}
div.ui-datepicker-group-last td {
    visibility:hidden;
}
div.ui-datepicker-group-last td.ui-datepicker-other-month ~ td:not(.ui-datepicker-other-month), div.ui-datepicker-group-last td:not(.ui-datepicker-other-month), div.ui-datepicker-group-last td:not(.ui-datepicker-other-month) ~ td.ui-datepicker-other-month {
    visibility:visible;
}

jsFiddle example

Sign up to request clarification or add additional context in comments.

1 Comment

Just somewhat? Seems to do exactly what you asked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.