Repository is archived
No commit activity in last 3 years
No release in over 3 years
Datepicker inputs for SimpleForm, updated for 3.1.0.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 0.8
~> 3.0
~> 2.4

Runtime

 Project Readme

simple-form-datepicker¶ ↑

<img src=“https://badge.fury.io/rb/simple-form-datepicker.png” alt=“Gem Version” />

Description¶ ↑

Provides an easy to use date picker for SimpleForm.

Features¶ ↑

  • Easy to use.

  • Localizable with I18n and I18n-js.

Examples¶ ↑

require 'simple-form-datepicker'

In your simple forms¶ ↑

= f.input :date_attribute, :as :datepicker

In app/assets/javascripts/application.js¶ ↑

//= require jquery.ui.all

or

//= require jquery.ui.datepicker

Also load localisations for JQueryUI’s datepicker:

//= require jquery.ui.datepicker-en
//= require jquery.ui.datepicker-es
//= require jquery.ui.datepicker-fr

Initialize JQueryUI’s datepicker:

$("input.datepicker").each(function(input) {
  $(this).datepicker({
    dateFormat: "yy-mm-dd",
    altField: $(this).next()
  })

  // If you use i18n-js you can set the locale like that
  $(this).datepicker("option", $.datepicker.regional[I18n.currentLocale()]);
})

In app/assets/stylesheets/application.css¶ ↑

*= require jquery.ui.datepicker

Requirements¶ ↑

  • simple_form

  • JqueryUI / jquery-ui-rails

TODO¶ ↑

  • How to use with i18n-js.

Install¶ ↑

$ gem install simple-form-datepicker

Copyright © 2013 Paul d’Hubert

See LICENSE.txt for details.