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

detect_timezone_rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect_timezone_rails

  • 0.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Detect Timezone Rails

This is a simple gem which bundles jstimezonedetect and my own jquery plugin for it

NOTE: There is no dependency on jquery, so you can also use this to simply bundle jstimezonedetect.

How to use it

In your Gemfile:

gem 'detect_timezone_rails'

Require detect_timezone and jquery.detect_timezone in your Javascript manifest (i.e. application.js)

//= require detect_timezone
//= require jquery.detect_timezone

Then some where else, wire it up using the plugin (remember to require jquery as well for the plugin)

$(document).ready(function(){
	$('#your_input_id').set_timezone(); 
});

If you are using the standard rails form helpers to generate a timezone select, you may pass the format option when calling set_timezone, to return only the city name:

$(document).ready(function(){
    $('#your_input_id').set_timezone({format: 'city'});
})

Disclaimers

Requires Rails 3.1+.

License

Provided under the Do Whatever You Want With This Code License.

FAQs

Package last updated on 25 Jul 2013

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