Rik Knijff
Posts: 0
Joined: Fri May 02, 2014 5:15 pm

I only want to show data of the next 7 days

I found a topic concerning my question,

so far I got the following code:

var d = new Date();
d.setDate(d.getDate() + 7);
var dateStr = d.toISOString();
return '{"Datum_product":{"$":"'+ dateStr +'"}}';

but my knowledge of JavaScript is very bad so can you help me do this for my app?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

I only want to show data of the next 7 days

Hello Rik,

Please look at this link: http://devcenter.appery.io/documentat...
Here you can find how to create date queries to Appery.io DB.

Rik Knijff
Posts: 0
Joined: Fri May 02, 2014 5:15 pm

I only want to show data of the next 7 days

Thnx for the link, helped me a lot.

I still have two questions:

How do I add 7 days to the currentDate?

{ "Datum_Product" : {"$lt" :"currentDate"} }

Second I use currentDate but it needs another date format:
But is still don't know how to convert the date in the database to the right format

Here is a old topic of mine with the same question:
https://getsatisfaction.com/apperyio/...

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

I only want to show data of the next 7 days

Hello Rik,

For substructing days you can use this code:
codedate.setDate(date.getDate() - 7);/code
For formatting:
code $.datepicker.formatDate('dd/mm/yy',date); /code

Return to “Issues”