没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > instantcalendar |
instantcalendar
|
0 | 0 | 2 |
贡献者 | 讨论 | 代码提交 |
Instant CalendarDisplays a simple HTML calendar. Appearance and behaviour of the calendar is fully customizable.
Usage1. ruby script/plugin install git://github.com/unni123/instantcalendar.git
2. Rails >= 2.0
rake instant_calendar:setup
Rails < 2.0
rake instant_calendar:setup_old
3. Restart your application
4. See examples below
Examples1. Displays the calendar of current month & year
2. Displays the calendar of March, current year
3 %>
3. Displays the calendar of March, 1985
3, :year => 1985 %>
4. Highlight today's date
true %>
5. Highlighting selected dates
[10,15,28] %>
6. Custom text for selected dates.
{ 5 => "xyz", 26 => "abc" } %>
In the calendar, date 5 will be replaced by 'xyz', and 26 by 'abc'
7. Linking specific dates to specific URLs.
{ 12 => link_to("12","/events/123") } %>
{ 12 => link_to("12",event_path(123)) } %>
{ 12 => link_to("Twelve",event_path(123)) } %>
8. Ajax links
{22 => link_to_remote("22",:url => "/events/123",:method => :get) } %>
{22 => link_to_remote("22",:url => event_path(123),:method => :get) } %>
9. Javascript actions
{15 => link_to_function("15","alert('Hello');") } %>
{15 => "
Appearance1. A calendar.css file is generated and used by the plugin (public/stylesheets/calendar.css). Edit this file to customize appearance of the calendar.
2. Weight of the calendar is not restricted. It occupies the full width of its container.
3. Every date (rectangle holding each date - table's TD) has a unique ID of the form 'date_1','date_12' etc. This also can be used for extra styling or may be behaviour control with UJS etc.
AuthorUnnikrishnan KP
Blog: http://unnionrails.blogspot.com
Contact: unni.tallman@gmail.com
Any feedback/comment/issue is welcome!