开发者

JavaScript Recurring Appointments Library

I'm looking for a JavaScript library t开发者_StackOverflow社区hat 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?


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.


You can probably use the answers of this question: How to check/calculate the week-day count (using Date functions) using Javascript?


I made a javascript / typescript library for handling complex recurring schedules: rSchedule

I was previously using a javascript library called rrule, but ended up making my own library so that I could handle timezones as well as recurring schedules made up of recurring schedules. I also wanted to make use of the latest es6 features (i.e. generators).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜