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

RE: [ydn-javascript] Re: minDate and maxDate

Expand Messages
  • Steven Peterson
    In order to successfully apply minDate/maxDate to the 2up Calendar, you need to apply to each of the sub-calendars. For instance: my2upCal.pages[0].minDate =
    Message 1 of 4 , Jun 27, 2006

      In order to successfully apply minDate/maxDate to the 2up Calendar, you need to apply to each of the sub-calendars. For instance:

       

      my2upCal.pages[0].minDate = myDate;

      my2upCal.pages[1].minDate = myDate;

       

      If you do this, you should see the restrictions as you expect them.

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!

      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of kds_orri
      Sent: Tuesday, June 27, 2006 3:44 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Re: minDate and maxDate

       


      Thanks for pointing to the examples. However when I try to run them
      with a double calendar, minDate/maxDate and restrictedDate does not
      seem to work. For example if I take the example at
      http://developer.yahoo.com/yui/examples/calendar/min_max_date/index.html
      and change it as following, dates before minDate are still selectable.

      function init() {
      YAHOO.example.calendar.cal1 = new
      YAHOO.widget.Calendar2up("YAHOO.example.calendar.cal1","cal1Container");

      YAHOO.example.calendar.cal1.minDate =
      YAHOO.widget.DateMath.add(new Date(), YAHOO.widget.DateMath.DAY, 1);
      YAHOO.example.calendar.cal1.render();

      }

      > JavaScript dates have 0-indexed months, so 7/5/2006 would be "new
      > Date(2006,6,5)".
      >
      >
      >
      > There is an example available online at:
      >
      href="http://developer.yahoo.com/yui/examples/calendar/min_max_date/index.html">http://developer.yahoo.com/yui/examples/calendar/min_max_date/index.html
      >
      >
      >
      > Also, you may want to look at the Date object documentation
      (specifically,
      > the parameters for the constructor) at:
      >
      http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Ob
      > jects:Date#Parameters
      >
      >
      >
      > Steven Peterson
      >
      > Web Developer, Platform Engineering
      >
      > Yahoo!
      >
      > From: ydn-javascript@yahoogroups.com
      [mailto:ydn-javascript@yahoogroups.com]
      > On Behalf Of kds_orri
      > Sent: Monday, June 26, 2006 11:40 AM
      > To: ydn-javascript@yahoogroups.com
      > Subject: [ydn-javascript] minDate and maxDate
      >
      >
      >
      > hi
      >
      > I´m using the calendar to enable users to select vaccation periods,
      > and I need to be able to restrict users from selecting certain days,
      > e.g. ending the vaccation before it starts. Therefore I need to make
      > some days restricted. I've read that minDate and maxDate can be used
      > for this purpose. I've tried the following code, but it does not make
      > dates before 2006/7/5 restricted. Does anyone have an idea what Im
      > doing wrong or provide an example on how to use minDate/maxDate.
      >
      > function init(){
      >
      > cal_2 = new YAHOO.widget.Calendar2up("cal_2",
      >
      "container2",(thisMonth+1)+"/"+thisYear,(thisMonth+1)+"/"+thisDay+"/"+thisYe
      > ar);
      >
      > cal_2.setChildFunction("onSelect",setDate2);
      > cal_2.minDate = new Date(2006,7,5);
      > cal_2.render();
      > }
      >
      > thanx in advance // orri
      >

    Your message has been successfully submitted and would be delivered to recipients shortly.