Page 1 of 1

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

Posted: Wed Mar 12, 2014 6:58 pm
by Stephen Koford

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


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

Posted: Wed Mar 12, 2014 7:16 pm
by Nikita

Hello,

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


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

Posted: Wed Mar 12, 2014 7:19 pm
by Stephen Koford

Thanks for the quick reply.

When I do that, I get

"yesterday is not defined' in the console


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

Posted: Wed Mar 12, 2014 7:39 pm
by Nikita

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


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

Posted: Thu Mar 13, 2014 2:38 pm
by Stephen Koford

got it thanks