This is probably the simplest of problems but my knowledge of javascript is basic to say the least.
I'm trying to use the jQuery UI Datepicker with a certain configuration, I want Sundays and Mondays to be unselectable and I need the date returned to be in UK format.
At the moment I have found the scripts to do one or the other, due to my limited knowledge though I am unable to combine them into one script that will work.
Here's the two snippets of code:
<script type="text/javascript">
$(function() {
$("#datepic").datepicker(
{ beforeShowDay: function(day) {
var day = day.getDay();
if (day == 0 || day == 1) {
return [false, "somecssclass"]
} else {
return [true, "someothercssclass"]
}
}
});
});
</script>
<script type="text/javascript">
$(function() {
$("#datepic").datepicker({dateFormat: 'DD d MM yy'});
});
</script>
Any help would be much appreciated! Also if anyone knows how to make the date picker disable dates that occur in the past, that would be doubly helpful!!
Thanks guys