Friday, 9 June 2017

Verify recurring time periods in Javascript

I'm trying to find a node module which will help me to verify recurring time periods, which can be checked to see if they are currently active.

For example, I want to get a schedule called "Office Hours" (as a JSON object from a database), which will be active between 08:00 and 17:00 on weekdays. A function should then be able to check if that schedule is currently active, returning a promise with either true or false.

If I call the function on Monday morning at 11am, it should return "true". If I call the function on Tuesday at 19:00, it should return "false".

I've looked at later.js and schedule.js, but neither of these seem to fit what I'm looking for.

Many thanks,

Jason



via Jason Berryman

No comments:

Post a Comment