If you encounter issues with your JSON data, try copying and pasting it into a text editor to examine it.
Make sure to verify the output of your service in a text document rather than just relying on a web browser.
https://i.sstatic.net/LSUK4.png
UPDATE:
To illustrate this point, I have created a fiddle using correct JSON data.
var appdata = {"Response":[{"challenge":"rp6lssenku72b2ppr4gkjb4q92","startTime":"2016-04-26 10:41:46.0","successfullyCompleted":false,"id":1,"username":"bojan1037"},{"chalennge":"ljtqvmk1mcqqqg5m0op0fljnek","startTime":"2016-04-26 10:49:56.0","successfullyCompleted":false,"id":4,"username":"bojan1037"},{"chalennge":"h062sm69lpkib7t3sk4fuppi1v","startTime":"2016-04-26 14:53:31.0","successfullyCompleted":false,"id":10,"username":"bojan1037"}],"Error":""}
var date = 1;
var appjson = JSON.stringify(appdata);
console.log(appjson);
var postResponse = jQuery.parseJSON(appjson);
var postResponse2 = postResponse.Response;
var post = [];
console.log(postResponse2.length);
for (i=0; i<postResponse2.length; i++) {
var data = postResponse2[i];
var dt = new Date(postResponse2[i]['startTime']);
var day = (dt.getMonth() + 1) + '-' + dt.getDate() +
'-' + dt.getFullYear();
if (day == date) {
post = post.concat(data);
console.log(data);
}
}
console.log(post);
https://jsfiddle.net/xnku481d/
I have also created a fiddle demonstrating incorrect JSON data.
var date = 1;
var appdata = {"Response":[{"challenge":"rp6lssenku72b2ppr4gkjb4q92","startTime":"2016-04-26 10:41:46.0","successfullyCompleted":false,"id":1,"username":"bojan1037"},{"chalenge":"ljtqvmk1mcqqqg5m0op0fljnek","startTime":"2016-04-26 10:49:56.0","successfullyCompleted":false,"id":4,"username":"bojan1037"},{"challenge":"h062sm69lpkib7t3sk4fuppi1v","startTime":"2016-04-26 14:53:31.0","successfullyCompleted":false,"id":10,"username":"bojan1037"}],"Error":""}
var appjson = JSON.stringify(appdata);
console.log(appjson);
var postResponse = jQuery.parseJSON(appjson);
var postResponse2 = postResponse.Response;
var post = [];
console.log(postResponse2.length);
for (i=0; i<postResponse2.length; i++) {
var data = postResponse2[i];
var dt = new Date(postResponse2[i]['startTime']);
var day = (dt.getMonth() + 1) + '-' + dt.getDate() +
'-' + dt.getFullYear();
if (day == date) {
post = post.concat(data);
console.log(data);
}
}
console.log(post);
https://jsfiddle.net/xnku481d/1/
It is important to validate your data to avoid any discrepancies.