Jquery datepicker different colors BeforeShowDay

Jquery datepicker different colors BeforeShowDay

Hello,

I have a question about the BeforeShowDay function. I have 2 types of data. Once red and yellow. I would like both to be marked in the calendar on a specific date. Only the date "yellow" is displayed and this works as well. How can I extend the function, that red and yellow are displayed. A date, which either in Array eventDatesyellow and eventDatesred should stay grey (-->default).

Here is my Script:

  1.  <script type="text/javascript"> $(function() { var eventDatesyellow = {}; var eventDatesred = {}; <?php for($i=0;$i<=sizeof($view)-1;$i++){ $date = explode(":" , $view[$i]); echo "eventDatesyellow[ new Date( '" . $date[1] . "' )] = new Date( '" . $date[1] . "' );"; } ?> $("#datepicker").datepicker({ firstDay: 1, dateFormat: "yy-mm-dd", maxDate: new Date, minDate: "2016-03-08", dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], onSelect: function(dateText, inst) { $("#datepicker_value").val(dateText); $(this).parent('form').submit(); }, beforeShowDay: function(date) { // exclude weekends if (!$.datepicker.noWeekends(date)[0]) return [false, '', '']; // highlight dates return [true, eventDatesyellow[date] ? 'eventyellow' : '', '']; } }); }); </script>

I hope someone can help me!