Reputation: 307
I need to code the following functionality:
For example: If the user selects 13th April and frequency 60 minutes the system should show the following options:
If the user selects frequency 30 minutes I should print out: - 8:00 to 8:30 - 8:30 to 9:00 - 9:00 to 9:30 - 9:30 to 10:00 - 10:00 to 10:30 - and so on...
I would need help to come out with a good logic to build a function in order to do that. Inside this function I will check a calendar on a DB to see if the slot is available but I'm having some troubles to think on the best approach here. Do you guys have any good suggestion/example (especially to handle times in jquery)
I appreciate your help!
Upvotes: 0
Views: 49
Reputation: 115
With the Moment.js library, you can simply add minutes, seconds, ... to a given date.
Upvotes: 1