bootstrap-timepicker icon indicating copy to clipboard operation
bootstrap-timepicker copied to clipboard

How to disable a time or time range?

Open konstantinfo opened this issue 9 years ago • 12 comments

Hello, I am using the this timepicker with bootstrap but i didn't find the way to disable any time or time range. Can you please explain how we can disable a time?

konstantinfo avatar Aug 20 '15 06:08 konstantinfo

What do you mean "disable a time"? you can use the disabled attribute on input elements to disable the input element.

mrhota avatar Aug 20 '15 18:08 mrhota

@konstantinfo Let me know if you solved this or you still need help.

mrhota avatar Aug 21 '15 15:08 mrhota

@konstantinfo is this still an issue?

mrhota avatar Aug 26 '15 20:08 mrhota

As bootstrap datepicker plugin has startDate / endDate this plugin should have too.

Idea is to have option to enable specific time range to be entered and rest to disable.

vukasin-nikodijevic avatar Aug 27 '15 11:08 vukasin-nikodijevic

bootstrap datepicker is a separate project. Can you not achieve this by listening for changeTime events and performing whatever business logic you need?

mrhota avatar Aug 29 '15 20:08 mrhota

@mrhota - yep I can but idea is to have it easily achievable by config. This as config is requested by lot of users - I'm sure in that.

On the other hand is going to help users with basic knowledge of JS.

Currently I'm doing as you suggested.

vukasin-nikodijevic avatar Aug 29 '15 21:08 vukasin-nikodijevic

I think the idea is ok, but I'm not sure what the best interface for it is. I'm not really in love with the maxHours option we already have. I don't like adding more and more config options as people come up with new ideas. I think consolidating related options into a single-valued option and possibly accepting an object for those options would cut down on clutter. I don't know yet.

The timepicker currently only deals with one type of time (http://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices/3269325#3269325), but people use the timepicker for entering several different types of time. I'm not yet sure how to proceed so that the timepicker can be used correctly for each type of time.

mrhota avatar Aug 31 '15 00:08 mrhota

Maybe config params like: startTime, endTime ?

vukasin-nikodijevic avatar Aug 31 '15 06:08 vukasin-nikodijevic

@vukasin0: I agree that this would be really helpful!

schme16 avatar Sep 29 '15 06:09 schme16

@konstantinfo mentioned problem occurred to me. (i want to disable time range - 08:00 AM to 10:00 AM) .

Amaraweera avatar May 11 '16 05:05 Amaraweera

Is this implemented yet? =/

Braintelligence avatar Feb 28 '17 19:02 Braintelligence

@Braintelligence maybe not

wladimiravila avatar Apr 18 '18 19:04 wladimiravila