2 Replies Latest reply on May 28, 2009 8:13 AM by bouanani

    asking help with rich:calendar

      i'm wondering if i can disable some special dates in the rich:calendar and prevent a user to select these dates , i'v tryed with this exemple but it does'nt work as it should be ;

      var curDt = new Date();
       var xdate ;
       var ydate ;
       function disablementFunction(day)
       {
       if (curDt==undefined)
       {
       curDt = day.date.getDate;
       }
       if (test==undefined)
       {
       test = new Date(2009,07,01);
       if ((day.isWeekend)||(curDt.getTime() - day.date.getTime() > 0)||(test.getTime() == day.date.getTime()))
       {
       return false;
       }
       else
       {
       return true ;
       }
       }
       else
       {
       for (var i=0 ; i < (test.length)-1 ; i++ )
       {
       xdate = test.split("-");
       ydate = new Date(parseInt(xdate[0]),parseInt(xdate[1]-1),parseInt(xdate[2]));
       if ((day.isWeekend)||(curDt.getTime() - day.date.getTime() > 0)||(ydate.getTime() == day.date.getTime()))
       {
       return false;
       }
       else
       {
       return true ;
       }
       }
       }
       }

      <====> The ''test'' variable is containing a liste of string of dates stored in my database <===>
      i'm asking juste to explaine for me how to disable some dates in my calendar component