datepicker - beforeShowDay database

datepicker - beforeShowDay database

Hi!

I have a database with news (date - description - link - so on..)
I would like to change css from every date into datepicker to help users know which date has news.

Here is my code, I implemented a filter here.

  1. <script>
  2. $(function() {
  3. $("#datepicker").datepicker({
  4. changeMonth: true,
  5. changeYear: true,
  6. beforeShowDay: // need help here! :)
  7. onSelect: function(selectedDate) {
  8. var mydate;
  9. fecha = $("#datepicker").attr("value");
  10.             $.ajax({
  11.                 type: "GET",
  12.                 url: "news.php",
  13. data: 'datepicker='+mydate,
  14.                 success: function(data) {
  15.                     $('#result').html(data);
  16.                   }
  17.             });
  18.         }

  19.     });
  20. });

  21. </script>

I think I can do it with a function: beforeShowDay, but I don't know how, I am learning jquery and I was surfing the web without luck until now.

Hope someone can help me with this.
Thank u so much!