You can use the jQM datebox as follows:
Create an input
with type="date"
and set the mode as desired. If you want to respond to the new date as soon as the user sets it, you can add a callback for closeCallback
.
<input name="Date1" id="Date1" type="date" data-role="datebox" data-options='{"mode": "calbox", "closeCallback": "onClose" }' />
function onClose(){
alert($('#Date1').datebox('getTheDate').getDay());
}
You can also just get the date later, say when a button is clicked:
$('#btndatebox').on('click', function () {
var currDate = $('#Date1').datebox('getTheDate').getDay();
alert(currDate);
});
getDay()
is the javascript function for getting the day of the week from a date object.
Here is a DEMO