Skip to content

Instantly share code, notes, and snippets.

@aparshin
Created February 29, 2012 06:21
Show Gist options
  • Save aparshin/1938488 to your computer and use it in GitHub Desktop.
Save aparshin/1938488 to your computer and use it in GitHub Desktop.
Test timepicker work without instance
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script src="js/jquery-ui-timepicker-addon.js"></script>
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.18.custom.css"/>
<link rel="stylesheet" href="css/jquery-ui-timepicker-addon.css"/>
<script>
$(function()
{
$('#btnTest').click(function()
{
$('#datepicker').datepicker('disableTimepicker');
$('#datepicker').datepicker('enableTimepicker');
$('#datepicker').datepicker('setTime');
$('#datepicker').datepicker('setDate');
$('#datepicker').datepicker('getDate');
$('#datepicker').datepicker('option', 'test');
})
});
</script>
</head>
<body>
<input id="datepicker"></input>
<button id="btnTest">Test me</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment