I'm getting an empty response on the Map. The list service works pefectly fine on the map, and I see all the address on the database, but when I use query with a data range, it's not working. Here are some pics below.
HI Mike,
Here is solution for you:
Delete link to "where" request parameter.
Click "JS" on "where" request parameter.
Populate JS editor with following code:
pre
var d1 = new Date(Apperyio("startDate").datapickerRoot.find("input").val()).toISOString().replace(/T.*/gi, "");
var d2 = new Date(Apperyio("endDate").datapickerRoot.find("input").val()).toISOString().replace(/T.*/gi, "");
var whereObject = {$and: [ {"date": {$gt: d1} }, {"date": {$lt: d2} } ] };
return JSON.stringify(whereObject);
/pre
Details: http://prntscr.com/4wk3w6/direct
Regards.
I tried this code:
var d1 = new Date(Apperyio("mobiledatepicker_1").datapickerRoot.find("input").val()).toISOString().replace(/T./gi, "");
var d2 = new Date(Apperyio("mobiledatepicker_2").datapickerRoot.find("input").val()).toISOString().replace(/T./gi, "");
var whereObject = {$and: [ {"date": {$gt: d1} }, {"date": {$lt: d2} } ] };
return JSON.stringify(whereObject);
It didn't work.
Regards,
Hi Mike,
I gave you tested code and it should work.
May be you confuse start and end date?
Please show us "request" in browser debugger network tab where we can see "where" request parameter.
Regards.
Thanks Yuri, I'll test again.
I ran the debugger, and the problem is that it querying the date in this format 2014-10-03 , and the dates in the database look like this: 10/03/2014 (i.e MM/DD/YYYY)
Regards,
Hi Mike,
Please give us your app public link and describe steps to reproduce this problem.
We will take a look.
Thanks & regards.
I'll email you the steps and credentials.
Hi Mike,
Could you please resend your mail to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a (with reference to this thread)
Hi Mike,
Thank you, I will pass this information to our developers.