I need to highlight a datepicker method only for a specific input field

Viewed 11

There are 7 input fields in my code but I want to use them for only one. Also there are multiple pages where this datepicker is used all done through a common datepicker directive. I don't want the other pages and input fields to get affected with this change. Here is my code :

                beforeShowDay: function(date) {
                    var month = date.getMonth() + 1;
                    var year = date.getFullYear();
                    var day = date.getDate();
                    if (day < 10) {
                        day = '0' + day;
                    }
                    if (month < 10) {
                        month = '0' + month;
                    }
                    var newDate = month + "/" + day + "/" + year;
                    if (jQuery.inArray(newDate, highlight_date) != -1) {
                        //console.log(newDate);
                        return [true, "highlight"];
                    }
                    return [true];
                }
0 Answers
Related