RubyGems Navigation menu

bjornblomqvist-input_chronic 1.0.5

= input_chronic A simple Rack middleware that parses a dates using Chronic, and returns the result in a standardized manner. The idea is to use this to verify the input in date input fields using AJAX, to provide immediate feedback to the user. == Usage Include "input_chronic" in your middleware stack. In Rails, this is done in environment.rb config.gem 'bjornblomqvist-input_chronic', :lib => 'input_chronic', :source => 'http://gems.github.com' config.middleware.use "input_chronic" This will catch requests to /gems.github.com/bjornblomqvist/input_chronic. Use GET requests and provide a parameter 'date' or 'datetime'. The value will be parsed by Chronic and returned formatted as 2009-01-01 or 2009-01-01 12:45, depending on the parameter name. Don't forget to add the javascript found at /javascript/input_chronic.js This is also implemented by catching the request before it reaches rails. To use this on a text input add the class chronic_date or chronic_datetime <input type="text" class="chronic_datetime" /> == Copyright Copyright (c) 2009 Erik Hansson, Bjorn Blomqvist. See LICENSE for details.

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 1.0.5 - August 11, 2014 (7 KB)
  2. 1.0.3 - August 11, 2014 (7 KB)
  3. 1.0.0 - August 11, 2014 (6.5 KB)

Development Dependencies (1):

rspec >= 0

Authors:

  • Erik Hansson, Bjorn Blomqvist

SHA 256 checksum:

37096ebc477600972c7d01d4a01f1b6384ed4a2436354a98525c156742cb6f94

Total downloads 9,670

For this version 3,811

Licenses:

N/A

Required Ruby Version: >= 0

Links: