Sets or gets whether after selecting hours, the element will automatically switch to minute selection.
Set the autoSwitchToMinutes
property.
$('#jqxTimePicker').jqxTimePicker({ autoSwitchToMinutes: false });
Get the autoSwitchToMinutes
property.
var autoSwitchToMinutes = $('#jqxTimePicker').jqxTimePicker('autoSwitchToMinutes');
Enables or disables the jqxTimePicker.
Set the disabled
property.
$('#jqxTimePicker').jqxTimePicker({ disabled: false });
Get the disabled
property.
var disabled = $('#jqxTimePicker').jqxTimePicker('disabled');
Sets or gets whether the footer is shown.
Set the footer
property.
<body>
<div id="timepicker"></div>
<template id="templateWithButtons">
<div id="buttonContainer">
<button>CANCEL</button>
<button>OK</button>
</div>
</template>
<script type="text/javascript">
$(document).ready(function () {
$("#timepicker").jqxTimePicker({
width: 400,
footer: true,
footerTemplate: "templateWithButtons"
});
$("#buttonContainer button").jqxButton();
});
</script>
</body>
Sets or gets the footer template. The value of this property can be the id of an HTMLTemplateElement or the HTMLTemplateElement itself. If set to null, a default, empty, template is applied. See footer property.
Sets or gets the whether hour selection format is using a 12-hour or 24-hour clock convention.
Possible Values:
'12-hour'
'24-hour'
Set the format
property.
$('#jqxTimePicker').jqxTimePicker({ format: '24-hour' });
Get the autoSwitchToMinutes
property.
var format = $('#jqxTimePicker').jqxTimePicker('format');
Sets or gets the jqxTimePicker's height.
Set the height
property.
$('#jqxTimePicker').jqxTimePicker({ height: '400px' });
Get the height
property.
var height = $('#jqxTimePicker').jqxTimePicker('height');
Sets or gets the step when selecting minutes.
Set the minuteInterval
property.
$('#jqxTimePicker').jqxTimePicker({ minuteInterval: 5 });
Get the minuteInterval
property.
var minuteInterval = $('#jqxTimePicker').jqxTimePicker('minuteInterval');
The name of the control.
Disables user interaction with the element.
$('#myTimePicker').jqxTimePicker({ readonly: true });
Sets or gets whether hour or minute selection is currently enabled.
Possible Values:
'hour'
'minute'
Set the selection
property.
$('#jqxTimePicker').jqxTimePicker({ selection: 'minute' });
Get the selection
property.
var selection = $('#jqxTimePicker').jqxTimePicker('selection');
Determines the theme. Theme defines the look of the element. Sets the widget's theme.
jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file. In order to set a theme, you need to do the following:
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.energyblue.css" type="text/css" />
If is set to true, the element cannot be focused.
$('#myTimePicker').jqxTimePicker({ unfocusable: true });
Sets or gets the value.
Set the value
property.
$('#jqxTimePicker').jqxTimePicker({ value: new Date() });
Get the value
property.
var value = $('#jqxTimePicker').jqxTimePicker('value');
Sets or gets whether the element is in landscape or portrait orientation.
Possible Values:
'landscape'
'portrait'
$('#jqxTimePicker').jqxTimePicker({ view: "landscape" });
Sets or gets the jqxTimePicker's width.
Set the width
property.
$('#jqxTimePicker').jqxTimePicker({ width: '400px' });
Get the width
property.
var width = $('#jqxTimePicker').jqxTimePicker('width');
This event is triggered when the value is changed.
$("#jqxTimePicker").on("change", function (event) {
var args = event.args;
var value = args.value;
var oldValue = args.oldValue;
// Get current hour
var hour = value.getHours();
// Get current minutes
var minutes = value.getMinutes();
console.log("New time: " + hour + ":" + minutes < 10 ? "0" + minutes : minutes); });
Sets the hours.
Invoke the setHours
method.
$('#jqxTimePicker').jqxTimePicker('setHours', 7);
Sets the minutes.
Invoke the setMinutes
method.
$('#jqxTimePicker').jqxTimePicker('setMinutes', 24);