jdewit / bootstrap-timepicker

[Deprecated] A simple timepicker component for Twitter Bootstrap
MIT License
1.64k stars 1.09k forks source link

How to disable a time or time range? #284

Open konstantinfo opened 9 years ago

konstantinfo commented 9 years ago

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?

mrhota commented 9 years ago

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

mrhota commented 9 years ago

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

mrhota commented 9 years ago

@konstantinfo is this still an issue?

vukasin-nikodijevic commented 9 years ago

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.

mrhota commented 9 years ago

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

vukasin-nikodijevic commented 9 years ago

@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.

mrhota commented 9 years ago

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.

vukasin-nikodijevic commented 9 years ago

Maybe config params like: startTime, endTime ?

schme16 commented 9 years ago

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

Amaraweera commented 8 years ago

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

Braintelligence commented 7 years ago

Is this implemented yet? =/

wladimiravila commented 6 years ago

@Braintelligence maybe not