$(document).ready(function() { var todaysDate = new Date(); var dayofWeek = todaysDate.getDay(); var year = todaysDate.getFullYear(); var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); var day = ("0" + todaysDate.getDate()).slice(-2); if (dayofWeek == 6) { numDaysAdd = 9; } else if (dayofWeek == 7) { numDaysAdd = 8; } else { numDaysAdd = 7; } todaysDate.setDate(todaysDate.getDate() + numDaysAdd); var dd = todaysDate.getDate(); var mm = todaysDate.getMonth() + 1; var y = todaysDate.getFullYear(); var minDate = mm + '/' + dd + '/' + y; $('.returnDate input').attr('min', minDate); });
I am using the above code to set the minimum date in a Return Date date picker field, adding 5 business days. For some reason, starting yesterday as far as i can tell, when i click on the field the date picker disappears and the field becomes a single line text field instead. if i comment out the last line of code, the part that sets the min attribute, everything works fine. This was working without issue up until yesterday.
Any input would be greatly appreciated.