// Funciona! BdD: Alemanys5
// Oju deixar espais o line break abans del javascript!
// Connexio: ok!
// Numero de EVENTS amb SUMMARY: 83
// Actualitzat: last_updated";s:19:"2024-02-18 10:38:03";}
jQuery(document).ready(function () {
jQuery(".avia_datepicker").datepicker({
beforeShowDay: function (date) {
function isUnavailable(date, unavailableRanges) {
var isUnavailable = false;
for (var i = 0; i < unavailableRanges.length; i++) { var startDate = unavailableRanges[i][0]; var endDate = unavailableRanges[i][1]; if (date >= new Date(startDate) && date <= new Date(endDate)) {
isUnavailable = true;
break;
}
}
return isUnavailable;
}
// Hard-coded unavailable date ranges in dd/mm/yyyy format
var unavailableRanges = [ ['27/02/2023','04/03/2023'],['10/03/2023','12/03/2023'],['27/03/2023','30/03/2023'],['03/04/2023','15/04/2023'],['03/04/2023','04/04/2023'],['08/04/2023','13/04/2023'],['17/04/2023','19/04/2023'],['28/04/2023','01/05/2023'],['04/05/2023','09/05/2023'],['12/05/2023','14/05/2023'],['19/05/2023','24/05/2023'],['28/05/2023','01/06/2023'],['26/05/2023','26/05/2023'],['06/06/2023','11/06/2023'],['14/06/2023','26/06/2023'],['13/06/2023','01/07/2023'],['23/07/2023','26/07/2023'],['30/07/2023','02/08/2023'],['29/08/2023','03/09/2023'],['07/09/2023','13/09/2023'],['17/09/2023','20/09/2023'],['06/10/2023','09/10/2023'],['24/10/2023','27/10/2023'],['28/12/2023','04/01/2024'],['16/03/2023','18/03/2023'],['24/03/2023','01/04/2023'],['23/04/2023','26/04/2023'],['22/07/2023','27/07/2023'],['25/09/2023','30/09/2023'],['21/12/2023','26/12/2023'],['13/05/2023','17/05/2023'],['28/07/2023','04/08/2023'],['15/08/2023','19/08/2023'],['16/08/2023','19/08/2023'],['31/03/2024','05/04/2024'],['02/09/2024','06/09/2024'],['06/08/2023','13/08/2023'],['10/07/2023','10/07/2023'],['22/08/2023','25/08/2023'],['22/04/2024','27/04/2024'],['11/06/2024','14/06/2024'],['28/06/2023','30/06/2023'],['03/07/2023','08/07/2023'],['12/07/2023','18/07/2023'],['11/10/2023','18/10/2023'],['04/08/2023','03/08/2023'],['14/09/2024','09/10/2024'],['07/04/2024','09/04/2024'],['17/05/2024','20/05/2024'],['29/05/2024','01/06/2024'],['22/09/2023','23/09/2023'],['03/10/2023','03/10/2023'],['13/04/2024','20/04/2024'],['22/11/2023','27/11/2023'],['21/11/2023','29/11/2023'],['29/11/2023','19/12/2023'],['14/09/2023','26/09/2023'],['30/04/2024','04/05/2024'],['06/05/2024','14/05/2024'],['30/10/2023','02/11/2023'],['03/03/2024','08/03/2024'],['06/08/2024','25/08/2024'],['06/01/2024','06/01/2024'],['11/10/2023','20/11/2023'],['03/12/2023','06/12/2023'],['20/01/2024','23/01/2024'],['24/03/2024','29/03/2024'],['23/02/2024','25/02/2024'],['28/12/2023','31/12/2023'],['10/03/2024','12/03/2024'],['26/10/2024','27/10/2024'],['08/01/2024','13/01/2024'],['10/03/2024','13/03/2024'],['26/01/2024','28/01/2024'],['02/11/2024','05/11/2024'],['17/07/2024','20/07/2024'],['05/07/2024','08/07/2024'],['18/03/2024','23/03/2024'],['25/03/2024','26/03/2024'],['21/06/2024','24/06/2024'],['17/10/2024','21/10/2024'],['08/01/2024','08/03/2024'],['27/08/2024','30/08/2024'] ];
return [!isUnavailable(date, parseDateRanges(unavailableRanges))];
},
beforeShow: function (input, inst) {
jQuery("#ui-datepicker-div").addClass(this.id);
inst.dpDiv.addClass("avia-datepicker-div");
},
showButtonPanel: true,
closeText: AviaDatepickerTranslation.closeText,
currentText: AviaDatepickerTranslation.currentText,
nextText: "Next",
prevText: "Prev",
minDate: "0",
dateFormat: "MM d, yy, DD",
firstDay: AviaDatepickerTranslation.firstDay,
isRTL: AviaDatepickerTranslation.isRTL,
changeMonth: true,
changeYear: true,
yearRange: "-00:+2"
// database generated
}); });
function parseDateRanges(dateRanges) {
return dateRanges.map(function (range) {
return [
new Date(range[0].split("/").reverse().join("/")),
new Date(range[1].split("/").reverse().join("/"))
];
});
}
function getFormattedRanges(dateRanges) {
return dateRanges.map(function (range) {
return range.join(" - ");
}).join("
");
}