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.
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();
});
Requires Rails 3.1+.
Provided under the Do Whatever You Want With This Code License.