Gnana Prasad Ruby

May 8, 2008

Calendar date select plugin for rails

Filed under: Uncategorized — gnanaruby @ 7:59 am

We have been searching for a better date picker for one of my application.

We found a rails plugin calendardateselect Its simply superb and work nicely in all most all browser.

Installation is simple:

1. script/plugin install http://calendardateselect.googlecode.com/svn/tags/calendar_date_select

Now, we just need to integrate it to your application.

2. First, in your layout/application.rb you need to add the javascript tag:

<%= calendar_date_select_includes "silver" %>

You can also use “red”, “blue” ,”plain”or “nil” for other color schemes.

3. Also note that you need to have prototype included as well, so if you haven’t already, you should also add the following to your layout:

<%= javascript_include_tag :defaults %>

and its ready to use it !!!

and its ready to use it, i was using to capture a persons date_of_birth as follows

4. <%= calendar_date_select_tag "person[date_of_birth]" %>

If you want more features of the calendar date select plugin ,Please visit calendar date select demos

5. If you want to change the default syntax of the calendar data select plugin add the following line to your copnfig/enivnorment.rb file below

CalendarDateSelect.format = :american

want to learn more about the DATE FORMATS supported by this plugin, Please digg the plugin code.It supports maximun FORAMTS.

6. This plugin allows a few more configuration options available for the calendar. You can find out more and get some screenshots by visiting the project’s homepage

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.