jQuery-Timepicker-Addon
jQuery-Timepicker-Addon copied to clipboard
minTime / maxTime not applied when set repeatedly
Minimum hour will still be 15, even after the second call to minTime. Tested with the current dev version from Github.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.4.5/jquery-ui-timepicker-addon.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script src="jquery-ui-timepicker-addon.js"></script>
<!--script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.4.5/jquery-ui-timepicker-addon.min.js"></script-->
<script type="text/javascript">
$(function() {
$('#test').timepicker({
stepMinute: 10,
minuteGrid: 10,
timeFormat: 'H:mm'
});
$('#test').timepicker('option', 'minTime', '15:00');
$('#test').timepicker('option', 'minTime', '10:00');
});
</script>
</head>
<body>
<input id="test" name="test" value="">
</body>
</html>
No problem when using minDateTime:
var dateObject = new Date(1970, 1, 1, 15, 00);
$('#test').timepicker('option', 'minDateTime', dateObject);
var dateObject = new Date(1970, 1, 1, 10, 00);
$('#test').timepicker('option', 'minDateTime', dateObject);
same problem. how to set minTime?
Same issue. Oh..
Quick hack is to destroy and create datetimepicker on each option update.
I can't set minTime or maxTime. I am using DateTimePicker with datepicker set to "false". Any help?
How to destroy the timepicker and call it again ?
If I didn't forget something, it should work like this (example with datetimepicker):
// your input jQuery object
var cdt = $('input[name=DateTime]');
// create datetimepicker
cdt.datetimepicker({
//your params
});
// destroy it
cdt.datetimepicker('destroy');
// create datetimepicker for a second time
cdt.datetimepicker({
//your params
});