Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple Rails 3.1+ gem for better timezone detection
Ruby
Branch: master
Pull request Compare This branch is 4 commits ahead, 5 commits behind scottwater:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
vendor/assets/javascripts
.gitignore
.rbenv-gemsets
Gemfile
Gemfile.lock
Rakefile
detect_timezone_rails.gemspec
readme.md

readme.md

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(); 
});

Disclaimers

Requires Rails 3.1+.

License

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

Something went wrong with that request. Please try again.