HI WELCOME TO KANSIRIS

jquery date picker disable specific dates from db in MVC

Leave a Comment

 Change your date format to dd-mm-yy instead of dd-mm-yyyy

// store all unavailable date in an array
var myDate=["25-12-2014","26-12-2014","27-12-2014"]; 

$("#pickdate").datepicker({
    dateFormat: 'dd-mm-yy',  // format is yy not yyyy
    beforeShowDay: function(date){
            var string = jQuery.datepicker.formatDate('dd-mm-yy', date);
            return [ myDate.indexOf(string) == -1 ]
      }
});

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.