我关注了这个 Railscast:http ://railscasts.com/episodes/213-calendars-revised
似乎没有很多人收到错误,但我收到ArgumentError: wrong number of arguments (1 for 0)
了这个电话:
first = date.beginning_of_month.beginning_of_week(START_DAY)
即使,如果我在控制台中尝试它也会给我同样的错误。
Date.today.beginning_of_month.beginning_of_week(start_day = :sunday)
Date.today.beginning_of_month.beginning_of_week(start_day = 'sunday')
Date.today.beginning_of_month.beginning_of_week('sunday')
Date.today.beginning_of_month.beginning_of_week(:sunday)
我已经用谷歌搜索了它并查看了文档,它似乎应该可以工作。我什至尝试过require 'active_support/all
,但它总是返回false
。
如何将星期的开始设置为星期日?