Page 2 of 3

Query a date range.

Posted: Tue Oct 14, 2014 3:23 pm
by Mike6979865

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.

Image

Image

Image


Query a date range.

Posted: Wed Oct 15, 2014 10:50 pm
by Yurii Orishchuk

HI Mike,

Here is solution for you:

  1. Delete link to "where" request parameter.

  2. Click "JS" on "where" request parameter.

  3. 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.


Query a date range.

Posted: Thu Oct 16, 2014 6:10 pm
by Mike6979865

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,


Query a date range.

Posted: Fri Oct 17, 2014 1:42 am
by Yurii Orishchuk

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.


Query a date range.

Posted: Fri Oct 17, 2014 1:45 am
by Mike6979865

Thanks Yuri, I'll test again.


Query a date range.

Posted: Fri Oct 17, 2014 5:29 pm
by Mike6979865

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,


Query a date range.

Posted: Mon Oct 20, 2014 12:00 am
by Yurii Orishchuk

Hi Mike,

Please give us your app public link and describe steps to reproduce this problem.

We will take a look.

Thanks & regards.


Query a date range.

Posted: Mon Oct 20, 2014 12:11 am
by Mike6979865

I'll email you the steps and credentials.


Query a date range.

Posted: Mon Oct 20, 2014 4:04 am
by Illya Stepanov

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)


Query a date range.

Posted: Mon Oct 20, 2014 3:50 pm
by Kateryna Grynko

Hi Mike,

Thank you, I will pass this information to our developers.