Plugins - datepicker_engine

StarAdd to favorites

DatepickerEngine

DatepickerEngine is a collection of helpers for creating datepicker boxes in your views.

Installation

  1. Create your Rails application, set up your databases, grab the Engines plugin and the DatepickerEngine, and install them.
  2. Install the DatepickerEngine into your vendor/plugins directory
  3. Modify your Engines.start call in config/environment.rb
     Engines.start :datepicker # or :datepicker_engine
    
  4. Edit your application.rb file so it looks something like the following:
     class ApplicationController < ActionController::Base
       include DatepickerEngine
     end
    
  5. Edit your application_helper.rb file:
     module ApplicationHelper
       include DatepickerEngine
     end
    
  6. The DatepickerEngine provides a default stylesheet and a small javascript helper file, so you’ll probably want to include the former and almost certainly the latter in your application’s layout. Add the following lines:
                         <%= engine_stylesheet "datepicker_engine", "calendar-blue" %>
                         <%= engine_javascript "datepicker_engine", "calendar", "lang/calendar-en", "calendar-setup" %>
    

Usage

You can create a datepicker popup box like this:

<%= datepicker_popup ‘person’, ‘birthday’,

        { :class => 'date',
          :field_title => 'Birthday',
          :button_title => 'Show calendar' },
        { :firstDay => 1,
          :range => [1920, 1990],
          :step => 1,
          :showOthers => true,
          :cache => true }
  %>

More examples in the API docs for the application helper

License

Copyright © 2006 Gitte Wange

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.

Gitte Wange

http://svn.mamatux.dk/rails-engines/datepicker_engine

Rails' (MIT)

  • Currently 4.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
mcbigelo 26 Jul 2007

i got the same problem :(

mby 21 Jul 2007
cause error when start server Engines.start :datepicker # or :datepicker_engine After I read swh to remove above line I get error when calling <%= datepicker_popup .... %> undefined method `engine_image_src'

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?