JavaScript 定期约会库
我正在寻找一个可以计算定期约会的 JavaScript 库。可以处理“每个第二个星期三”之类的事情。该解决方案只需 JavaScript 和客户端。我不需要日历,只需要可以进行定期约会计算的日期的东西。有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
phpjs.org 上有
strtotime()
的 JavaScript 实现。它似乎能够像基于 UNIX 时间戳一样进行计算。
您可以使用
strtotime("next wednesday")
(如果已实现)找到第一个星期三,然后使用strtotime("+2 week");
。我不知道如何看待 phpjs,而且我还没有使用过它,但也许这个功能适合你。
There is a JavaScript implementation of
strtotime()
over on phpjs.org. It seems to be able to do calculations likebased on UNIX timestamps.
You could find the first wednesday using
strtotime("next wednesday")
(If that's implemented), and then count on usingstrtotime("+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.
您可能可以使用这个问题的答案:如何使用 Javascript 检查/计算工作日计数(使用日期函数)?
You can probably use the answers of this question: How to check/calculate the week-day count (using Date functions) using Javascript?
我制作了一个 javascript / typescript 库来处理复杂的重复计划: rSchedule
我以前使用过一个名为 rrule 的 javascript 库,但最终制作了我自己的库,以便我可以处理时区以及循环计划由循环计划组成。我还想利用最新的 es6 功能(即生成器)。
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).