Disable Time Picker From Mysql
Currently I'm using html time picker, but wouldn't mind using Javascript/Jquery/Ajax instead. The problem I'm trying to solve is this: you are a customer, you ordered x from an emp
Solution 1:
@Lynob here is timepicker with disabled times. You need to put more time in the disabled array and it will work.
var input = $('#input-a');
var dissabledTime = ["11:00", "12:00", "13:00", "14:00"];
input.clockpicker({
autoclose: true,
afterDone: function() {
console.log(dissabledTime.indexOf($('#input-a').val()));
if(dissabledTime.indexOf($('#input-a').val()) != -1)
{
alert("My dear select other time i'm busy :)");
$('#input-a').val('');
}
},
});
Here is the whole fiddle
Regards,
George
Solution 2:
Assuming from what you are trying to say :
Store selected dates to mysql in date format. While querying, check the selected dates per user or how you wish to do it. Then proceed in this way.
This will be per session. You have to store the results in an array :
var disableddates = ["02-14-2015", "05-19-2013", "12-20-2014", "another one"];
functionDisableSpecificDates(date) {
varstring = jQuery.datepicker.formatDate('dd-mm-yy', date);
return [disableddates.indexOf(string) == -1];
}
You have to call the datepicker function later on.
$(function() {
$("#date").datepicker({
beforeShowDay: DisableSpecificDates
});
});
<!doctype html><html><head><metacharset="UTF-8"><title>Tite</title></head><body><inputid="date"type="text"></body></html>
You have to include jquery datepicker plugin and dependencies.
Post a Comment for "Disable Time Picker From Mysql"