Skip to content

Repository files navigation

Browser Timezone (for Rails)

This gem automatically detects the user's timezone offset from their browser by setting a cookie, then applies it in the controller by setting Time.zone to the appropriate timezone.

Installation

Add the gem to your Gemfile:

gem'browser-timezone',:git=>"git://github.com/magoosh/browser-timezone.git"

Usage

In your controller:

classApplicationController < ActionController::Baseset_timezone_from_browserend

That's it.

Thanks to @technoweenie's article for the inspiration.

About

Automatically detect the user's timezone and apply it in your Rails controllers

Resources

Stars

8 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages