Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

date_time_picker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date_time_picker

  • 0.5.9
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= DateTimePicker

A library allows to select date and time, which uses jQuery UI.

== Requirements

You should have +jquery-rails+ gem installed and require +jquery+ and +jquery-ui+ assets (don't forget to require CSS for your jQuery UI).

== Installation

Add this to your Gemfile and run the +bundle+ command

gem 'date_time_picker'

Run generator to create initializer

rails generate date_time_picker

or create file manually and activate date_time_picker inside an initializer:

DateTimePicker.activate :simple_form

You can pass only :simple_form to the activate method.

== I18n

By default plugin includes most using locales and you can require them from your application.js or using the helper, but if you want to add your locales or/and change one of them, then just put them into your assets dir.

== Usage

To add necessary assets add into your head

<%= date_time_picker_assets %>

Or you can add them manually by requiring +date_time_picker+ and +date_time_picker_locale+

To use the picker inside the form

<%= f.date_time_picker :datetime %>

To use it outside the form

<%= date_time_picker :datetime %>

To specify special options add them into the end

<%= t.date_time_picker :datetime, :id => 'input_id', :class => [:class_1, :class_2], :ampm => true %>

The full list of available options you can find on the {jQuery UI Datepicker docs}[http://docs.jquery.com/UI/Datepicker] and {jQuery UI Timepicker}[http://trentrichardson.com/examples/timepicker/].

By default plugin uses app locale, but if you want to specify it manually you can do this

<%= t.date_time_picker :datetime, :locale => :ru %>

Also available

<%= date_picker :date_only %>

<%= time_picker :time_only %>

== SimpleForm support

To use the picker inside the form

<%= f.input :created_at, as: :ui_date_time %>

Also available

<%= f.input :created_at, as: :ui_date %>

<%= f.input :created_at, as: :ui_time %>

FAQs

Package last updated on 23 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc