md-date-time-picker icon indicating copy to clipboard operation
md-date-time-picker copied to clipboard

Disable specific time in time picker

Open sohailrajdev97 opened this issue 7 years ago • 5 comments

There needs to be a feature to disable a specific time in the time picker dialog (Like the one in the date picker dialog where one can choose a starting date and all the dates before that chosen date are disabled).

sohailrajdev97 avatar Dec 21 '17 04:12 sohailrajdev97

Hi sohailrajdev97, Could you please provide an example of how to disable specific days? I still can't figure it out :(

lloydbanks avatar Jun 28 '18 17:06 lloydbanks

@lloydbanks. See the past argument in official docs.

https://puranjayjain.github.io/md-date-time-picker/#documentation/init

sohailrajdev97 avatar Jun 28 '18 17:06 sohailrajdev97

For an example, see line number 95 in this file : https://github.com/ID-BPHC/Instruction-Division-2.0/blob/master/views/room-booking/step1.jade

sohailrajdev97 avatar Jun 28 '18 18:06 sohailrajdev97

@sohailrajdev97 thanks for your reply and example, I know about past and future args and as I understand they allow only to subtract a whole period, e.g 7 days. What I mean is to disable specific single days, e.g: June 6 and June 11 should be not active.

lloydbanks avatar Jun 28 '18 18:06 lloydbanks

Hi, @sohailrajdev97 @lloydbanks there is no such provision in the current project to disable single days, however, you can do so by tinkering with the code.

I would suggest you add a class to each cell you want to disable, look here https://github.com/puranjayjain/md-date-time-picker/blob/master/src/js/mdDateTimePicker.js#L560 and add CSS attribute pointer-events: none; property

puranjayjain avatar Jul 11 '18 10:07 puranjayjain