Open Milenoi opened 7 years ago
I have the same issue, have you found the solution? :)
Have you tried using the onRenderHour
option for the datepicker?
The function would be something like this:
onRenderHour(date) {
var day = date.getUTCDay();
var hour = date.getUTCHours();
if ((day === 0 || day === 6) && (hour < 9 || hour > 21))
return ['disabled'];
}
if (hour < 12 || hour > 18) {
return ['disabled'];
}
}
I wrote the code out this way for clarity but it can certainly be simplified into one if
.
Same here, interested in this feature!
@RinkAttendant6 Doesn't the 'onRenderHour' function use variable 'hour' instead of 'date'? I am having trouble accessing the date variable during render of hours
Regarding https://github.com/smalot/bootstrap-datetimepicker/issues/667#issuecomment-345619592
@echan00 You can call the variable hour
if you want but it is still an instance of a Date
object
Hi, I want to disable some hours of dates like, 12.06.2018 5.30 am, 12.06.2018 2.00 pm. Is it possible ?
Hi dear Community,
i have a Question.
I need to customize my datetimepicker: Mo-Fr: hourMin=9, hourMax=21 Sat-So: hourMin=12, hourMax=18
additionally depending on special Dates (holidays!) i need to change this in the following way: holiday (e.g. 12.06.2017): hourMin=13, hourMax=17
tbc...
is there a way / idea to realize this with this plugin?
Thank you for your opinion / help ;)
Mel