I am using jQuery’s Datepicker for a textbox as below. I have restricted the days a user is allowed to select but my question is if there is a way to have a special text appeared in the textbox along with each selected date.
For example, if a user selects day number 1, then there is shown Monday, 19 September 2011 How to make it Monday, 19 September 2011 and a special name for the Monday here?
The same goes for all the available to select days like Tuesday, 20 September 2011 and a special name for the Tuesday here?
Thank you for this
<script>
$(document).ready(function() {
var date = new Date();
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
$('#datepicker').datepicker({
minDate: new Date(y, m, d),
dateFormat: 'DD, d MM yy',
beforeShowDay: function(date){
var day = date.getDay();
return [day == 1 || day == 4 || day == 5,""];
}
});
$( "#datepicker" ).datepicker( $.datepicker.regional[ "el" ] );
});
</script>
Add this array:
Then add this method:
Demo: http://jsfiddle.net/AlienWebguy/Xm6Dm/