Question

I am using carousal view and query date picker.I am using in phone gap.Once he drag and drop on to the date picker the date where he dropped need to highlight.How to do this.For me drop the image is working fine.But calendar date not highlighting the date.How to do that.I am pasting my code below

$(".item").draggable({
    revert: true
});

$("#datepicker").droppable({
    drop: function() {
        alert('Event added ');

    }
});

alert is displaying can anyone help me the date picker highlighting the date.

Was it helpful?

Solution

You should read up on the draggable, droppable and datepicker.

They have an example of how to use the drop function and how to retrieve the value, and datepicker has a method called setDate to set the date.

Here's how you would use it.

Live example | Code

$("#datepicker").datepicker();

$(".item").draggable({
    revert: true
});

$("#datepicker").droppable({
    drop: function(event, ui) {
        //Set date in datepicker
        $("#datepicker").datepicker("setDate", ui.draggable.text());
    }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top