Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  div {font-size: 0.7em}
 td.highlight {
    background-color: red;
    border: 1px blue solid;
}
</style>
</head>
<body>
<div class="demo"> 
 
<p>Date: <input type="text" id="datepicker"></p> 
 
</div><!-- End demo -->
</body>
</html>
 
var dates = ['04/22/2014', '05/01/2014'];
$(function(){
alert('')  ;
    $('#datepicker').datepicker({
                    
        dateFormat: 'dd/mm/yy',
        beforeShowDay: highlightDays
    });
    function highlightDays(date) {
        for (var i = 0; i < dates.length; i++) {
            if (new Date(dates[i]).toString() == date.toString()) {              
                          return [true, 'highlight'];
                  }//end of if
          }// end of for
          return [true, ''];
 }   
});
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers