To validate that a date (e.g., Birth Date) is earlier than today:
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) {
MyMsg.value = 'Birth Date must be earlier than today!';
DOB.valid = false;
} else {
MyMsg.value = '';
DOB.valid = true;
}
To calculate offsets using frevvo.addToDate():
var today = frevvo.currentDate();
var past = frevvo.addToDate(today, 'y', '-100'); // 100 years before today
var future = frevvo.addToDate(today, 'm', '3'); // 3 months from today
var tomorrow = frevvo.addToDate(today, 'd', '1'); // Tomorrow