Im trying to figure out how to pass a date in the format of yyyy-mm-dd through JS that I have done in PHP before, but PHP and JS being different in this sense. I am at a bit of a loss.
Heres how I did it in PHP:
var default_dob = strtotime(date('m/d/Y', time()) .' -18 year');
var dob = date('m/d/Y', default_dob);
essentially taking todays date, subtracting 18 years, and reformatting it so its mm/dd/yyyy for a date picker. Idealy I'd like to avoid adding in another plugin to my already big stack of JS. So if I can do this without the extra weight (outside of being able to plug it into maybe a ready made function Ill be happy)