2011-06-19 118 views
-4

可能重复:使用event_calendar插件
how to customize the table builder plugin for a week calendar ?如何更改event_calendar插件按月显示而不是按月显示?

IM,Git仓库:

https://github.com/elevation/event_calendar

我需要定制该日历由周上展示而不是一个月,我该怎么做?

这是我的控制器:

def index 
    do_withs = DoWith.where(:friend_id => current_user.id) 
    @statuses = do_withs.collect { |f| f.status_id } 
    @statuses = @statuses.collect { |f| Status.find(f) } 
    @statuses = @statuses + current_user.statuses 
    @statuses.flatten! 
    @date = params[:month] ? Date.parse(params[:month]) : Date.today 
    end 

,这是我的看法:

<div id="calendar"> 
    <h2 id="month"> 
    <%= link_to "<", :month => (@date.beginning_of_month-1).strftime("%Y-%m-%d") %> 
    <%=h @date.strftime("%B %Y") %> 
<%= link_to ">", :month => (@date.end_of_month+1).strftime("%Y-%m-%d") %> 
    </h2> 
    <% calendar_for @statuses, :year => @date.year, :month => @date.month do |calendar| %> 
    <%= calendar.head('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') %> 
    <% calendar.day(:day_method => :date) do |date, statuses| %> 
     <%= date.day %> 
     <ul> 
     <% for status in statuses %> 
      <li><%= link_to h(status.content), status %></li> 
     <% end %> 
     </ul> 
    <% end %> 
    <% end %> 
</div> 

其驾驶我疯了几天,现在,请请请,如果有人知道我怎么能自定义此日历让我知道。 感谢分配。

+0

看起来你有没有做过大量研究你将如何做到这一点。如果你有任何路径,你没有把它们放在帖子中,所以我们不研究同样的死胡同。 –

+3

这是一个确切的副本:http://stackoverflow.com/questions/6399810/how-to-customize-the-table-builder-plugin-for-a-week-calendar 这也是一个确切的副本: http://stackoverflow.com/questions/6397863/how-to-customize-the-table-builder-plugin-for-a-week-calendar –

回答