Get a next day of the week


#1

I’m creating an application that has a schedule request component to it. I need users to be able to log in and request a schedule. I can do all of this no problem. I can’t figure out how to validate the date the user is requesting.

The way the program is suppose to work is that you can request schedules for dates beyond the upcoming Saturday. So if today is Monday, I can request schedules for anything beyond this coming Saturday. After Saturday at noon, then I can only request schedules after the following Saturday. I guess this much less of a meteor question. But, are there any ideas about how to do this?


#2

Take a look at the moment.js library. It’s for formatting dates, calculating differences between times, getting info for next day/month etc.


#3

calculate start and end time of that interval by moment.js
and than just check if is greater than x and lower than y, as mongo have date data type.


#4

That worked perfectly. Thank you so much for the help.