Last active
September 9, 2017 15:28
-
-
Save amitabhaghosh197/36846c83f472fcdcb09f510b1bd6683e to your computer and use it in GitHub Desktop.
Custom DatePicker #javascript #jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta name="robots" content="noindex, nofollow"> | |
<meta name="googlebot" content="noindex, nofollow"> | |
<script type="text/javascript" src="//code.jquery.com/jquery-1.8.3.js"></script> | |
<link rel="stylesheet" type="text/css" href="/css/result-light.css"> | |
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> | |
<script type='text/javascript'>//<![CDATA[ | |
$(window).load(function(){ | |
var array = ["2013-03-14","2013-03-15","2013-03-16"]; | |
$('input').datepicker({ | |
beforeShowDay: function(date){ | |
var string = jQuery.datepicker.formatDate('d-yy-mm-dd', date); | |
return [ array.indexOf(string) == -1 ] | |
}, | |
onSelect: function(dateText, inst) { | |
var date = $(this).datepicker('getDate'); | |
dateString = new Date(date).toUTCString(); | |
dateString = dateString.split(' ').slice(0, 4).join(' ') | |
$('input').val(dateString); | |
} | |
}); | |
});//]]> | |
</script> | |
</head> | |
<body> | |
<input class="selector"/> | |
<p id="getAll"></p> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment