trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

How to set default/minimum start time and minutes. #910

Open virtualmayur opened 7 years ago

virtualmayur commented 7 years ago

I am using this library for timepicker and I have to set minimum start time and minutes, If I am using hour then it works at the time of open timepicker first time but here we can select previous hours. My basic requirement is that if I am filling any form at 7:35 PM then we can set start time after 8:35 PM to 11:59 PM. Please help me to do this. which attribute is used for this.

$.timepicker({ timeFormat: 'h:mm TT', ampm: true, controlType: 'slider', showOn: 'focus', hour: 8, minute: 20, });

Twincarb commented 7 years ago

The below is taken from the Options page so should be what your looking for,

minTime Default: null - String of the minimum time allowed. '8:00 am' will restrict to times after 8am maxTime Default: null - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm

minTime: '8:35 pm', maxTime: '8:59 pm',