w bazie danych mam zapisane dni cyklicznych wydarzeń np.: pon, śro, pt. Przez advAJAX pobieram te dane i chcę, za pomocą kalendarza je pokazać.

Cały problem polega na tym że, kalendarz jest "ładowany" w onLoad, i nie wiem jak mam ustawić ndExample1.DateChooser.setAllowedDays(['1', '3', '5']), po pobraniu listy dni.

Próbowałem dodać za pomocą oddzielnego skyptu w divie "c" ale to nie działa....

są to moje pierwsze działnia z js więc mogłem coś pokręcić, bardzo proszę o jakiekolwiek wskazówki

kalendarz: http://yellow5.us/projects/datechooser/

Kod
        events.add(window, 'load', WindowLoad);

        function WindowLoad()
        {
            var ndExample1 = document.getElementById('c');
            ndExample1.DateChooser = new DateChooser();

            // Check if the browser has fully loaded the DateChooser object, and supports it.
            if (!ndExample1.DateChooser.display)
            {
                return false;
            }

            ndExample1.DateChooser.setUpdateFunction(FunctionEx1);
            document.getElementById('datelinkex1').onclick = ndExample1.DateChooser.display;

            return true;
            
        }

        function FunctionEx1(objDate)
        {
            // objDate is a plain old Date object, with the getPHPDate() property added on.
            document.getElementById('dateinputex1').value = objDate.getPHPDate('F jS, Y');
            return true;
        }


  1. <div id="c">
  2.  
  3. var ndExample1 = document.getElementById('c');
  4. ndExample1.DateChooser.setAllowedDays(['1', '3', '5']);
  5. </script>
  6. </div>
  7. <a id="datelinkex1" href="#">Example 1</a>
  8. <input id="dateinputex1" type="text" value="">