Loading ...
Sorry, an error occurred while loading the content.

Re: error in Calendar eventSelect

Expand Messages
  • Satyen Desai
    Hi, Using 2.3.1 I don t see the problem, with this cleaned up/filled out version of your code: var cal1; cal1 = new
    Message 1 of 2 , Oct 9, 2007
    • 0 Attachment
      Hi,
      Using 2.3.1 I don't see the problem, with this cleaned up/filled out
      version of your code:

      var cal1;
      cal1 = new YAHOO.widget.Calendar("cal1","cal1Container",
      {
      pagedate: "2/2007",
      selected: "2/17/2007",
      mindate: "1/1/2000",
      maxdate: "1/1/2020"
      });

      YAHOO.util.Event.addListener("show1up",
      "click", cal1.show, cal1, true);

      var mySelectHandler1 = function(type,args,obj) {
      var s = args[0];
      alert(this._toDate(s[0]));
      this.hide();
      };

      cal1.selectEvent.subscribe(mySelectHandler1, cal1, true);
      cal1.render();
      cal1.hide();

      Main areas to look at:

      a). You're including both calendar.js and calendar-min.js. You should
      remove one of them.

      b). You're using the same variable (startDate) for both the pagedate
      and selected options. They both expect a different type of string
      format (http://developer.yahoo.com/yui/calendar/#config). You may also
      want to check what startDate is set to as part of your debugging effort.

      Hope that helps,
      Satyen
    Your message has been successfully submitted and would be delivered to recipients shortly.