I have the following javascript code
var list = [
{
Date : '2014-12-31 12:23:43',
DateStart: '1980-12-30 23:43:42',
Name: 'Kate',
...
...
},
{
Date : '1978-05-21 23:43:65',
DateStart: '1973-04-06 12:34:09',
Name: 'John',
...
...
}
];
And the following code to verify for regex pattern:
for (var i in list) {
var data = [];
if (/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/.test(list[i].?)) {
data.push({ Data: list[i].Data });
}
}
What can I do to all columns be verified for the date pattern?
Making the array date stay only with the values 2014-12-31 12:23:43,1980-12-30 23:43:42,1978-05-21 23:43:65,1973-04-06 12:34:09