date_ctrl.value = frevvo.currentDate();
// frevvo currentDate method gets today in users timezone var today = frevvo.currentDate().split('-'); var today_date = new Date(today[0], today[1]-1, today[2]); var bd = DOB.value.split('-'); var bd_date = new Date(bd[0],bd[1]-1,bd[2]); if (bd_date > today_date) { // needs a Message control named MyMsg MyMsg.value = 'Birth Date must be earlier than today!!!!'; DOB.valid = false; } else { MyMsg.value = 'This is a good Birth Date: ' + DOB.value; DOB.valid = true; }
var today = frevvo.currentDate().split('-'); var today_date = new Date(today[0], today[1] - 1, today[2]); for(var i=0; i<Date_CTRL_Name.value.length; i++){ var approve = Date_CTRL_Name[i].value.split('-'); var approve_date = new Date(approve[0], approve[1] - 1, approve[2]); if (approve_date > today_date) { Date_CTRL_Name[i].valid = false; } else { Date_CTRL_Name[i].valid = true; } } if(Repeater_Name.itemAdded){var x;}
var someDate = {CONTROL_DATE}.value; var today = frevvo.currentDate(); var past = frevvo.addToDate(today, 'y', '-100'); //Calculates 100 years before today (if the current date is 04/12/2000, it gives 04/12/1900) var future = frevvo.addToDate(someDate, 'm', '3'); //Calculates 3 months from someDate (if the date is a birthday on 04/12/2000, it gives 07/12/2000) var tomorrow = frevvo.addToDate(today, 'd', '1'); //Calculates tomorrow from today (if the current date is 04/12/2000, it gives 04/13/2000) // Setting the {CONTROL_DATE} to false if it is not in the past // Also prints a message to user asking them to enter a valid date before today if ( someDate >= today ) { {CONTROL_DATE}.valid = false; {CONTROL_DATE}.status = "Please enter a valid date before today's date."; } else { {CONTROL_DATE}.valid = true; {CONTROL_DATE}.status = null; }
if( YEAR.value.length > 0 ) { var today = new Date(); var y = today.getFullYear(); var yearsBack = 5; //Number of years in the past to allow if( y - yearsBack <= YEAR.value && YEAR.value <= y ) { YEAR.valid=true; } else { YEAR.valid=false; YEAR.status="Please specify a year from " + y - yearsBack + " to " + y; } }
if(form.load) { var today = new Date(); var year = today.getFullYear(); var month = today.getMonth(); var rangeOfYears = 10; var first = year -(rangeOfYears / 2); var years = []; for (var i=0; i < rangeOfYears; i++) { years[i] = (first + i).toString(); } Year.options = years; }