I have the following code
if (list.Date[0] != 'undefined') {
for (var i in list) {
var date = list[i].Data;
var year = date.substr(0, 4);
var month = date.substr(5, 2);
var day = date.substr(8, 2);
var newDate = day + "/" + month + "/" + year + " " + date.substr(11, 8);
list[i].Date = newDate;
}
}
It's inside a validation code, that makes the validation of all the forms. Some has the field date and others don't. How can I do a validation if inside the array has the date field?