The subset of code that you have included should work as is. I suspect some part of your code that you aren’t including in your snippet is causing the problem.
I guess what I’m trying to say is it’s very hard to help because the code you provided not only is not the code that doesn’t work for you, but is also not valid JavaScript code that I can try running on my computer.
Are you sure that there is data that matches those filters in your collection? Are objects in the date field actually JS Date objects? Are startDate and storeDate Date objects?
Again, it is hard to tell you what is wrong without having enough code to look at. For future reference, the best way is to create an entire app and put it on GitHub so that someone can clone it and tell you what to change.
Thanks for the input, I’ve basically jumped from the codeacademy’s js and html/css course into meteor so I’m just on a huge learning spree. So sorry for the all bad practices I show.
Here is my date code:
var dateOffset = (24*60*60*1000) * 5;
var checkDate = new Date();
var storeDate = Date.now();
var startDate = checkDate.setTime(checkDate.getTime() - dateOffset);
I’ve tested it and the data older than 5 days doesnt show up so I guess it works…
Also I have to point out that I’m on windows if that means anything