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

chronic_ping

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chronic_ping

  • 0.4.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

chronic_ping

Simple rails engine that uses ajax to ping Chronic, giving users imediate feedback regarding the date they entered in a text field.

Demo

Build Status

Requirements

  • chronic
  • rails > 3.1 using asset pipeline
  • jquery-rails

Usage

In your Gemfile

gem 'chronic_ping'

In your assets/javascript/application.js

//= require chronic_ping

In your form

= f.text_field :due_at, class: 'chronic_ping'

Customize

The following values are already set by default, but if you want to customize them, create a file called config/initializers/chronic_ping.rb that should look something like this:

ChronicPing.configure do |config|
  config.formats = {
    default:        '%B %d, %Y at %I:%M%p',
    datetime:       '%B %d, %Y at %I:%M%p',
    date:           '%B %d, %Y',
    my_new_format:  '...'
  }
end

To use a custom predefined format just specify it in a data-format attribute:

= f.text_field :born_on, class: 'chronic_ping', data: {format: 'date'}

Or you can put a format string directly into the data-format attribute:

= f.text_field :born_on, class: 'chronic_ping', data: {format: '%m/%d/%Y'}

License

This project rocks and uses MIT-LICENSE.

FAQs

Package last updated on 13 Mar 2015

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