You are here: Browse Railsplugins Edge
= DhtmlCalendar
DhtmlCalendar is a plugin
Installation
1. Create your Rails application, set up your databases, grab the DhtmlCalendar plugin, and install it.
2. Install the DhtmlCalendar into your vendor/plugins directory
ruby script/plugin install http://dhtml-calendar.googlecode.com/svn/branches/edge
or
cd vendor/plugins
svn co http://dhtml-calendar.googlecode.com/svn/branches/edge
3. Add the following line to your application’s layout:
<%= dhtml_calendar_includes %>
Usage
How to use this engine
Note: :form_name is optional unless your form is named. If it is named then supply the name of the form. or <%= calendar ‘person’, ‘birthday’, { :form_name => form_name, :class => ‘date’ }, { :firstDay => 1, :range => [1920, 1990], :step => 1, :showOthers => true } %> or <%= calendar ‘person’, ‘birthday’, { :class => ‘date’, :form_name => ‘form_name’}, { :firstDay => 1, :range => [1920, 1990], :step => 1, :showOthers => true } %> or <%= calendar_field ‘person’, ‘birthday’, { :class => ‘date’, :date => value, :field_title => ‘Birthday’, :form_name => ‘form_name’, :button_title => ‘Show calendar’ }, { :firstDay => 1, :range => [1920, 1990], :step => 1, :showOthers => true, :cache => true } %> or <%= calendar_select ‘person’, ‘birthday’, { :class => ‘date’, :date => value, :field_title => ‘Birthday’, :form_name => ‘form_name’, :button_title => ‘Show calendar’ }, { :firstDay => 1, :range => [1920, 1990], :step => 1, :showOthers => true, :cache => true } %> or <%= calendar_box ‘person’, ‘birthday’, { :class => ‘date’, :date => value, :field_title => ‘Birthday’, :form_name => ‘custform’, :button_title => ‘Show calendar’ }, { :firstDay => 1, :range => [1920, 1990], :step => 1, :showOthers => true, :cache => true } %>
<%= popup_calendar 'person', 'birthday',
{ :class => 'date',
:field_title => 'Birthday',
:button_image => 'calendar.gif',
:form_name => 'form_name',
:button_title => 'Show calendar' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true,
:cache => true }
%>
You can control the format stored in the DB via (default value is ‘%Y-%m-%d’):
ActiveRecord::Base.localize_date_format = '%Y-%m-%d'
UPDATES
Added DateBox/DateBocks: :sub_type => :select :box :field :popup :flat :field
License Copyright© 2006 4ssoM LLC <ed>The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly