Skip to content

Instantly share code, notes, and snippets.

@iaditya
Created January 24, 2017 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaditya/8112f8ffddf70f5e1e30b501efc4bf30 to your computer and use it in GitHub Desktop.
Save iaditya/8112f8ffddf70f5e1e30b501efc4bf30 to your computer and use it in GitHub Desktop.
select: function(startDate, endDate, jsEvent, view,resource) {
// here startDate and endDate will give you the date-range selected
//alert(startDate);
//alert(slotType);
console.log(view);
if (!startDate.hasTime()) {
// alert("Date has time: " + startDate.hasTime());
return false;
// should be all-day
}
var start = startDate;
var end = endDate;
var facility_id = resource.id;
jQuery.ajax({
type:'GET',
beforeSend: function(xhr) {
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
},
async: true,
cache: false,
url: '/patients/findAdd?slot_type='+ slotType + '&provider_id='+provider_id+'&facility_id='+facility_id+'&start='+startDate.toString()+'&end='+endDate.toString(),
data: {
"start": startDate.toString(),
"end":endDate.toString()
},
success: function(response) {
//alert(response);
$('#addEventModalBody').html(response);
$('#addEventModal').modal();
},
error: function(e) {
alert("error: " + e.responseText.message);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment