Stephen Koford
Posts: 0
Joined: Tue Mar 11, 2014 3:49 pm

How to list the dates from a database from only the past week?

I followed the tutorial here: https://www.youtube.com/watch?v=r7bSY...

And have the chat system set up as above. How do I make the listMessageService display only the last week's messages?

I added 'where' for a request parameter. After reading the documentation on Querying, I am still confused. I simply want to display CURRENTDATE THROUGH LAST 7 DAYS.

Maybe do JS on the where clause?

var d = new Date();
d.setDate(d.getDate());
var dateStr = d.toISOString();

..then what?

Thanks in advance

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

How to list the dates from a database from only the past week?

Hello,

Here is an example for 1 day, and you should change it to 7:
https://getsatisfaction.com/apperyio/...

Stephen Koford
Posts: 0
Joined: Tue Mar 11, 2014 3:49 pm

How to list the dates from a database from only the past week?

Thanks for the quick reply.

When I do that, I get

"yesterday is not defined' in the console

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

How to list the dates from a database from only the past week?

Please define yesterday variable:
yesterday = new Date();

Return to “Issues”