Hello,
I am trying to customize by datepicker to block national holidays and some other useful dates which I don't want people to be allowed to select. I don't see this functionality in Gravity Forms datepicker so I would like to know where to add my javascript?
I have searched the forums and it says put in in your page template. I don't want to get out of my depth by just placing it anywhere. Would you be able to direct me to the template I should be editing to add this code or maybe I can do it directly in gravity forms via some snippet or something?
Thanks
Code I am trying to add:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {
$(".selector").datepicker({ beforeShowDay: nationalDays})
natDays = [
[1, 26, 'au'], [2, 6, 'nz'], [3, 17, 'ie'],
[4, 27, 'za'], [5, 25, 'ar'], [6, 6, 'se'],
[7, 4, 'us'], [8, 17, 'id'], [9, 7, 'br'],
[10, 1, 'cn'], [11, 22, 'lb'], [12, 12, 'ke']
];
function nationalDays(date) {
for (i = 0; i < natDays.length; i++) {
if (date.getMonth() == natDays[i][0] - 1
&& date.getDate() == natDays[i][1]) {
return [false, natDays[i][2] + '_day'];
}
}
return [true, ''];
}
});
</script>
Code grabbed from here http://stackoverflow.com/questions/501943/can-the-jquery-ui-datepicker-be-made-to-disable-saturdays-and-sundays-and-holid