Calendar JavaScript functions
Use the following JavaScript functions in your calendar, they are implemented by WebSphere Commerce by default. The following functions are defined in the parent frame, and are called using parent.functionName():
Function Name Description validDate(String inYear, String inMonth, String inDay) This function validates a selected date. It returns true if the date is valid, otherwise, it returns false. isLeapYear(int Year) This function determines if a particular year is a leap year. It returns true if it is a leap year, otherwise, it returns false. getCurrentYear() This function returns the current year. getCurrentMonth() This function returns the current month. getCurrentDay() This function returns the current day. validateStartEndDateTime(String inStartYear, String inStartMonth, String inStartDay, String inEndYear, String inEndMonth, String inEndDay, String startTime, String endTime) This function checks that the end date and time is after the start date and time. This is useful for validating two dates to make sure that one is greater or equal to the other. Validate the dates before calling this function to ensure that they are in this format. This function expects the startTime and endTime arguments to be in HH:MM format. Validate the times first to make sure they are in this format. Input: startDate, endDate, startTime, endTime. Enter null for the date arguments if you only require a time comparison.. Enter null for time arguments if you only require a date comparison. Enter all arguments if you require both date and time comparisons.
This function returns one of the following values: Return code = true, endDate+endTime > startDate+startTime Return code = false, endDate+endTime < startDate+startTime Return code = -1, endDate+endTime == startDate+startTime
showCalendar(Object calImg) This function shows the calendar window, positioned according to the referenced object Related concepts
Related tasks