steveosoule
1/22/2015 - 1:27 AM

JavaScript - Over 18 Check

JavaScript - Over 18 Check

// var userAge = +new Date( $('#age-input').val() );
var userAge = +new Date('1997-01-21');
var eighteenYearsAgo = (+new Date()) - (31560000000 * 18);
var validAge = userAge <= eighteenYearsAgo;