I'm using this to select date and time. The documentation does not mention about time picker, but it works anyhow.
HTML:
<div class="dateTimePicker">
<input name="start" type="text" value="">
<span class="add-on"><i class="time-icon"></i></span>
</div>
JS:
$(".dateTimePicker").datetimepicker({
pickDate: false,
pickTime: true,
useSeconds: false,
format: 'hh:mm'
});
This works all fine. It shows a selector with intervals of 1 hour for hours, 3 minutes for minutes and 3 seconds for seconds.
My aim is to change the intervals of minutes from 3 to 15. Currently, the selector for minutes shows: 00 03 06 etc
. Can I change it to 00 15 30 45
. Is this even possible or are there any other time pickers which give me this flexibility?
You can restrict the users from selecting a date within the particular range by specifying MinDate and MaxDate properties. The default value of MinDate property is 1/1/1920 and MaxDate property is 12/31/2120 . Dates that appears outside the minimum and maximum date range will be disabled (blackout).
By default, the Interval for the Time Picker is 15 minutes, 30 minutes, and 1 hour. However, by adding a small code snippet to your site, you can easily create as many different Intervals for your form.
A date and time picker (DTP) control provides a simple and intuitive interface through which to exchange date and time information with a user. For example, with a DTP control you can ask the user to enter a date and then easily retrieve the selection.
$(".dateTimePicker").datetimepicker({
step: 15
});
This is how sets interval in jquery datetimepicker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With