Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh DateTimePicker not working + rainforest javascript

    Hi,

    I am using datetimepicker from rainforest.From the code below The pCtrl value is open date but the exDateTime value is read undefined becoz of this the window is not opening....Can you please tell me what is wrong in this code?


    Here is the code:
    <script language="javascript" type="text/javascript" src="/js/datetimepicker.js">
    </script>
    ..
    ,...
    ...
    <td width="25%" class="tableContainer" id="opendate">Open Date(mm/dd/yyyy) * </td>
    <td width="25%" ><input type="text" size="25" name="opendate" id="opendate" class="inputBox4"><a href="javascript:NewCal('opendate','mmddyyyy')"><img onmouseover="this.style.cursor='hand'" src="/ts/images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
    </td>

    And the javascript code:
    function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)
    {
    Cal=new Calendar(dtToday);
    if ((pShowTime!=null) && (pShowTime))
    {
    Cal.ShowTime=true;
    if ((pTimeMode!=null) &&((pTimeMode=='12')||(pTimeMode=='24')))
    {
    TimeMode=pTimeMode;
    }
    }
    if (pCtrl!=null)
    Cal.Ctrl=pCtrl;
    if (pFormat!=null)
    Cal.Format=pFormat.toUpperCase();
    alert("pCtrl-->"+pCtrl);
    //exDateTime=document.getElementById(pCtrl).value;

    exDateTime = "00/00/0000";
    alert("exDateTime-->"+exDateTime);
    if (exDateTime !="")//Parse Date String
    {
    var Sp1;//Index of Date Separator 1
    var Sp2;//Index of Date Separator 2
    var tSp1;//Index of Time Separator 1
    var tSp1;//Index of Time Separator 2
    var strMonth;
    var strDate;
    var strYear;
    var intMonth;
    var YearPattern;
    var strHour;
    var strMinute;
    var strSecond;
    //parse month
    Sp1=exDateTime.indexOf(DateSeparator,0)
    Sp2=exDateTime.indexOf(DateSeparator,(parseInt(Sp1)+1));

    if ((Cal.Format.toUpperCase()=="DDMMYYYY") || (Cal.Format.toUpperCase()=="DDMMMYYYY"))
    {
    strMonth=exDateTime.substring(Sp1+1,Sp2);
    strDate=exDateTime.substring(0,Sp1);
    }
    else if ((Cal.Format.toUpperCase()=="MMDDYYYY") || (Cal.Format.toUpperCase()=="MMMDDYYYY"))
    {
    strMonth=exDateTime.substring(0,Sp1);
    strDate=exDateTime.substring(Sp1+1,Sp2);
    }
    if (isNaN(strMonth))
    intMonth=Cal.GetMonthIndex(strMonth);
    else
    intMonth=parseInt(strMonth,10)-1;
    if ((parseInt(intMonth,10)>=0) && (parseInt(intMonth,10)<12))
    Cal.Month=intMonth;
    //end parse month
    //parse Date
    if ((parseInt(strDate,10)<=Cal.GetMonDays()) && (parseInt(strDate,10)>=1))
    Cal.Date=strDate;
    //end parse Date
    //parse year
    strYear=exDateTime.substring(Sp2+1,Sp2+5);
    YearPattern=/^\d{4}$/;
    if (YearPattern.test(strYear))
    Cal.Year=parseInt(strYear,10);
    //end parse year
    //parse time
    if (Cal.ShowTime==true)
    {
    tSp1=exDateTime.indexOf(":",0)
    tSp2=exDateTime.indexOf(":",(parseInt(tSp1)+1));
    strHour=exDateTime.substring(tSp1,(tSp1)-2);
    Cal.SetHour(strHour);
    strMinute=exDateTime.substring(tSp1+1,tSp2);
    Cal.SetMinute(strMinute);
    strSecond=exDateTime.substring(tSp2+1,tSp2+3);
    Cal.SetSecond(strSecond);
    }
    }
    winCal=window.open("","DateTimePicker","toolbar=0,status=0,menubar=0,fullscreen=no,width=195,height= 200,resizable=0,top="+cnTop+",left="+cnLeft);
    docCal=winCal.document;
    RenderCal();
    }

    Thanks in Advance

  • #2
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Were you able to resolve your issue. I am trying to find out how to pick a date in the past. Thank you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •