views:

46

answers:

2

I'm looking for a JavaScript library that can calculate recurring appointments. Something that can handle things like "every 2nd Wednesday". The solution needs to be JavaScript and client side only. I don't need a calendar, just something that can do the date recurring appointment calculations. Any suggestions?

A: 

There is a JavaScript implementation of strtotime() over on phpjs.org. It seems to be able to do calculations like

 strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200);

based on UNIX timestamps.

You could find the first wednesday using strtotime("next wednesday") (If that's implemented), and then count on using strtotime("+2 weeks");.

I 'm not sure what to think about phpjs in general and I haven't worked with it, but maybe that function cuts it for you.

Pekka