$('#with-altField').multiDatesPicker({
altField: '#altField',
addDates: ['18.04.2016','21.04.2016','11.05.2016','03.06.2016','06.06.2016','11.06.2016','10.06.2016','20.06.2016','23.06.2016','15.08.2016','02.09.2016','25.08.2016','10.09.2016','24.09.2016','26.03.2017','25.03.2017','30.04.2017','04.06.2017','04.06.2017','12.09.2017','06.10.2017','04.11.2017','26.12.2016','25.01.2018','28.02.2018','03.03.2018','05.03.2018','10.06.2018','16.07.2018','23.07.2018','08.09.2018','26.08.2018','17.09.2018','27.09.2018','20.12.2018','25.12.2018','28.12.2018','16.02.2019','27.01.2019 ','02.02.2019','17.02.2019','12-14.02.2019','09.02.2019','23.02.2019','05.03.2019','05.05.2019','21.04.2019','19.04.2019','06-09.06.2019 ','27.02.2019','28-30.06.2019','23.07.2019','13.05.2018','31.07.2019','30.06.2019','8-12.05.2019','01.06.2019','02.08.2019','05.07.2019','16-17.07.2019','10.07.2019','10.05.2019','21-23.06.2019','15.06.2019','19.06.2019','12.06.2019','11.06.2019','11-12.06.2019','04.06.2019','10.06.2019','19-23.08.2019','28.06.2019','12.04-12.06.19','26.08.2019','25.08.2019','2-5.09.2019','27.02.2019','28.09-01.10.2019','28.09.2019-04.10.2019','10.09-12.09.2019','12.11.2019','31.07.2019','11.09.2019','02.10.2019','17.11.2019','02.01.2020','01.02.2020','20.02.2020','07.10.2019 ','15.10.2019','08.11.2019','16.12.2019','21.12.2019','13.11.2019','18.12.2019','18.12.2019','11.11.2019','18-20.11.2019','10.11.2019','30.11.2019','11.02.2020','01.02.2020','01.11.2019','25.02.2019','06.03.2020','17.03.2020','10.05.2020','27.01-01.02.20','21.07.2020','21.07.2020','24.07.2020','31.07.2020','10.08.2020','08.08.2020','08.08.2020','09.08.2020','10.08.2020','11.08.2020','26.08.2020','28-02.09.2020','28.08.2020','30.08.2020','31.08.2020','01.09.2020','02.09.2020','03.09.2020','15.09.2020-15.12.2020','28.08-09.09.2020','18.09.2020','30.09.2020','23.09.2020','27.09.2020','19.09.2020','11-13.02.2020','24-28.12.2019','28.11.2020'],
onSelect:function(date,x){
$('#with-altField').multiDatesPicker('resetDates');
var width = $(window).width();
if(width<650) {
$(".full-div").fadeIn(200);
}
var uniCheck = $('.university-check:checked').map(function() {return this.value;}).get().join(',')
var programCheck = $('.program-check:checked').map(function() {return this.value;}).get().join(',')
var left = $(".ui-datepicker-current-day").offset().left+52;
var top = $(".ui-datepicker-current-day").offset().top-50;
$(document).find("#event-div").css({"top":top,"left":left}).show();
$("#event-inner").fadeOut(100,function(){
$("#no-result").hide();
$("#event-spinner").fadeIn(100);
$(".full-div").fadeIn(100);
});
setTimeout(function(){
$.ajax({
url : '/az/get-event-by-date.html',
type : 'get',
dataType:'html',
data : {"event_date":date,'program':programCheck,'university':uniCheck},
success: function (data)
{
if(data==false) {
$("#event-spinner").fadeOut(100,function(){
$(".special-date").html(date);
$("#event-div").addClass('no-result-box');
$("#no-result").fadeIn(200)
});
} else {
$("#event-inner").html(data);
$("#event-spinner").fadeOut(100,function(){
$("#event-inner").fadeIn(200)
});
}
},
error : function ()
{
console.log('internal server error');
}
});
},700);
}
});