
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
= 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
Unknown package
We found that date_time_picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.