dev1234
dev1234

Reputation: 5716

jquery multiple datepicker calender shade out from previous month to this month

What is the possible way to stop this issue ?

Please check the below given fiddler. http://jsfiddle.net/cse_tushar/3t4j9/4/

<input id="datePick" type="text"/>

$('#datePick').multiDatesPicker();

in the calender, select a date and then again go to next month and select another day. So, lets say u have selected August 8, 2013 & September 9, 2013 when u select another from september, you will notice as soon selected calender comes up to August month which should be in Sepetember month showing the selected dates. This is the dafult behaviour of it and I think there should be a way to resolve it.

Please let me knw

Upvotes: 1

Views: 506

Answers (2)

Tim Hobbs
Tim Hobbs

Reputation: 2017

I'd try something like one of the examples on the plugin docs page. Check out this fiddle. I am keeping the display of the calendar static to avoid the reset to the default date.

HTML

<input id="dates" type="text"/>
<div id="datePick" />

JS

var dates = [];
$('#datePick').multiDatesPicker({
    onSelect: function (e) {
        dates.push(e);
        var dateList = "";
        $.each(dates, function (i, d) {
            if (dateList.length > 0) {
                dateList += ",";
            }
            dateList += d;
        });
        $("#dates").val(dateList);
    }
});

It isn't necessarily the prettiest js - I am sure it could be better, but it illustrates the idea.

I believe one issue you may have is - what date do you display? You cannot assure the user will pick dates in any certain order. Do you always use the last selection for the month? I guess if you wanted to do that you could hook into the "onSelect", parse the last selection and set the default date to that month? That may work the way you'd like.

EDIT

I just saw there is an "altField" that does the same thing my fiddle does. Oh well. :)

EDIT 2

Check this fiddle. It parses the last date (like I mentioned above) but I am not sure how to set the plugin "default" date. It may not be possible without editing the plugin. At least it is a start...

Upvotes: 1

Shareek Ahamed
Shareek Ahamed

Reputation: 378

As I noticed, when selecting each date there is a refresh occurring....!

According to my knowledge-base I think, it is handle in "datepicker-ui" js file...

u might have to do some slight adjustments inside that file, to cope up your requirement.

May be I am wrong.

An Expert in datepicker UI js will will be able to help you out.

Upvotes: 1

Related Questions