gpt4 book ai didi

ruby-on-rails - 冰立方的开放时间

转载 作者:行者123 更新时间:2023-12-04 03:40:59 31 4
gpt4 key购买 nike

我如何能够在一个时间表中规定餐厅的营业时间?

周一至周五 8-16 日非常简单:

schedule = Schedule.new(Time.parse(Date.yesterday.to_s + ' 8:00'), :duration => 60*60*8)
(...)
schedule.add_recurrence_rule Rule.daily.day(:wednesday)
schedule.add_recurrence_rule Rule.daily.day(:thursday)
(...)
schedule.occurring_at?(Time.now)

问题是当试图统治这样的事情时:周一 9-17,Tu 16-01(次日午夜后)等等

我能用那个插件做到这一点吗?

最佳答案

刚收到一位 Ice_Cube 作者的电子邮件,回答了我的问题。可能有用:

Unfortunately we strive to maintain backwards compatibility with the iCalendar standard - so you can't change durations on a per-rule basis. If you want to accomplish something like the above, people either use multiple schedules, or store the durations separately (the latter is highly preferred)

关于ruby-on-rails - 冰立方的开放时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13496841/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com