Skip to content Skip to sidebar Skip to footer

Jquery Mobile Datepicker Change Month On Swipe

is there a way to change the datepicker's month on swipe? I mean any way to display next and previous month on swipe? Here is my approach: Jquery Mobile Swipe: // Bind the swipeHan

Solution 1:

use the getDate method to get the date, add a month and then set the using the setDate method to set the new date.

here's the example for the swipe right:

var thedate=$(".date-input-inline").datepicker('getDate'); //get date from datepicker
 thedate.setMonth(thedate.getMonth()+1); //add a month 
 $(".date-input-inline").datepicker('setDate',thedate); // set the date in datepicker

swipe left would have same type of code, you just need to subtract a month.

Post a Comment for "Jquery Mobile Datepicker Change Month On Swipe"