Giter Site home page Giter Site logo

instantcalendar's Introduction

Copyright (c) 2009 Unnikrishnan KP, released under the MIT license

Instant Calendar 
===============

Displays a simple HTML calendar. Appearance and behaviour of the calendar is fully customizable.

Usage
=====

1. 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

Example
=======

1.Displays the calendar of current month & year

<%= show_calendar %>    

2. Displays the calendar of March, current year 

<%= show_calendar :month => 3 %>

3. Displays the calendar of March, 1985

<%= show_calendar :month => 3, :year => 1985 %>

4. Highlight today's date

<%= show_calendar :highlight_today => true %>

5. Highlighting selected dates

<%= show_calendar :highlight_dates => [10,15,28] %>

6. Custom text for selected dates.

<%= show_calendar :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.

<%= show_calendar :dates => { 12 => link_to("12","/events/123") } %>
<%= show_calendar :dates => { 12 => link_to("12",event_path(123)) } %>
<%= show_calendar :dates => { 12 => link_to("Twelve",event_path(123)) } %>

8. Ajax links

<%= show_calendar :dates => {22 => link_to_remote("22",:url => "/events/123",:method => :get) }   %>
<%= show_calendar :dates => {22 => link_to_remote("22",:url => event_path(123),:method => :get) } %>

9. Javascript actions

<%= show_calendar :dates => {15 => link_to_function("15","alert('Hello');") } %>
<%= show_calendar :dates => {15 => "<span onmouseover=\"alert('Hello');\" >23</span>"} %>

Appearance
==========

1. 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. Width 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. 


===========================================================================================

  Author: Unnikrishnan KP
  Blog: http://unnionrails.blogspot.com
  Contact: [email protected]
  Plugin Homepage: http://code.google.com/p/instantcalendar/

  Any feedback/comment/issue/donation is welcome!

===========================================================================================

instantcalendar's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

instantcalendar's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.