bootstrap-datetimepicker
bootstrap-datetimepicker copied to clipboard
onRenderHour issue?
I have a strange issue or maybe I doing something wrong.
date
not return 24 numbers. How can I figure out with this?
onRenderHour: function(date) {
if (date.getDay() === 0 || date.getDay() === 6) { //for weekends
console.log(date.getHours()); // return 3...23
console.log(date.getUTCHours()); // return 0...20
if (date.getUTCHours() >= 2 && date.getUTCHours() <=23)
return ['disabled']; // issue 21,22,23 still open...
}
}
UPDATE
This issue was caused by this statement if (date.getDay() === 0 || date.getDay() === 6) {}
I don't know the reasone but out of the condition it works fine.