移动约会时应如何更新 iCal RRULE?
我正在将应用程序的日历从 Telerik Scheduler 切换到 jQuery fullcalendar。我使用 iCal RRULE 将重复事件存储在数据库中。
问题是,当有人将事件拖到新日期时,我如何更新 RRULE 以便每个后续事件都会受到相同的时间增量影响?
我查看了 DDay.iCal,看到了听起来类似于我正在寻找的方法
RecurrencePattern.IncrementDate(ref iCalDateTime dt, int Interval)
,但 文档。
有什么建议吗?
非常感谢,
迈克尔
I'm switching my app's calendar from Telerik Scheduler to jQuery fullcalendar. I'm storing recurring events in the db using iCal RRULEs.
The question is, when someone drags an event to a new date, how can I update the RRULE so each subsequent occurrence is bumped by the same time delta?
I've looked at DDay.iCal and I see the method
RecurrencePattern.IncrementDate(ref iCalDateTime dt, int Interval)
That sounds like what I'm looking for, but there are no details in the documentation.
Any suggestions?
Thanks so much,
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RecurrencePattern.IncrementDate 并不真正意味着在库本身之外使用。也许我会考虑将其设置为受保护/私有(如果可以在不破坏整体功能的情况下完成)。
一般来说,您所需要做的就是按您确定的增量(例如 1 天)更改事件的开始,并且该事件中的每次重复也将按该量进行更改。
如果您不希望增量更改整个事件,而只希望更改特定事件,那么还有其他方法可以处理该问题。
您能否通过示例事件、您想要移动它的增量以及预期结果来澄清?
RecurrencePattern.IncrementDate is not really meant to be used outside of the library itself. Perhaps I'll look into making it protected/private (if it can be done without breaking the overall functionality).
Generally, all you need to do is change the Start of the event by the delta you've determined (let's say 1 day, for example), and every recurrence in that event will also be changed by that amount.
If you don't want the entire event to be changed by the delta, but only a specific occurrence, then there's other ways to handle that.
Could you clarify perhaps with an example event, the delta you want to move it, and the expected result?