var formattedDate = new Date(parseInt(thisObj.Patient.DateOfBirth.substr(6)));
When i print my Date Object, i get this as output.
Wed May 04 2011 09:30:00 GMT+0530 (GMT+05:30)
How can i separate May, 04 and 2011 into separate variables like
var Month = May;
var Date = 04;
var Year = 2011;
How i can also check whether the Age of the person is below one year or not.
The object has many handy methods – use them.
Date Object on w3schools
getDate(): returns the day of the month (from 1-31)getFullYear(): returns the year (four digits)getMonth(): returns the month (from 0-11)