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

date_select_separator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date_select_separator

  • 0.0.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DateSelectSeparator Build Status

Add separators to data_select and datetime_select on Ruby on Rails.

Installation

Add this line to your application's Gemfile:

gem 'date_select_separator'

And then execute:

$ bundle

Usage

Add translations to your locale file like below.

ja:
  datetime:
    separators:
      year: 年
      month: 月
      day: 日
      hour: 時
      minute: 分
      second: 秒

Add use_separators: true option to data_select or datetime_select.

# Add a separator after each select_tags
<%= f.date_select :birthday, use_month_numbers: true, use_separators: true %>
<%= f.datetime_select :birthday, use_month_numbers: true, time_separator: '', use_separators: true %>

# Add a separator to each option_tags except month. Month is used a value like ja.data.month_names
<%= f.date_select :birthday, use_separators: { inline: true } %>
<%= f.datetime_select :birthday, time_separator: '', use_separators: { inline: true } %>

# Options: html_tag, class_prefix, translations, wrapper_select_tag etc
<%= f.date_select :birthday, use_month_numbers: true, use_separators: { html_tag: :div, class_prefix: 'foo_' } %>
<%= f.date_select :birthday, use_month_numbers: true, use_separators: { year: 'yy', month: 'mm', day: 'dd' } %>
<%= f.date_select :birthday, use_month_numbers: true, use_separators: { wrapper_select_tag: true } %>
<%= f.date_select :birthday, use_month_numbers: true, use_separators: { wrapper_select_tag: { html_tag: :span, class_prefix: 'foo_' }} %>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 18 Jul 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