<datepicker>

This is the jQuery-UI datepicker. All options and events are supported.

It’s probably easiest to add this to your application.dryml:

<def tag="input" for="Date">
  <datepicker dateFormat="yy-mm-dd" merge />
</def>

It’s probably useful to set global options such as dateFormat in application.dryml and set local options such as yearRange in the tag invocation:

<input:birthdate yearRange="1900:#{Date.today.year}" />

New in version 2.0:

If you do not specify dateFormat, we will attempt to convert I18n.t(:”date.formats.default”) from strftime format into the format that the JQuery-UI datepicker likes.

Note that if you set date.formats.default, it’s highly recommended that you install the delocalize gem. (https://github.com/clemens/delocalize)

Show Source


Edit this page