No commit activity in last 3 years
No release in over 3 years
JavaScript Timezone Converter library for rails applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

JavaScript TimeZone Converter ( for rails )

JavaScript Timezone converter library for rails applications. Basically lets you do timezone conversions in the browser, useful for client side applications. It also supports Daylight-Saving-Time.

Installation

Add this line to your application's Gemfile:

gem 'js-timezone-converter-rails'

And then execute:

$ bundle install

In your application.js, include the javascript file:

//= require js-timezone-converter

In your main layout file application.html.erb, include this tag inside the body section:

<%= js_timezone_converter_data %>

Usage

the converter

date = new Date; // => Thu May 16 2013 23:49:58 GMT+0300 (IDT)
date.at("Pacific Time (US & Canada)") // => Thu May 16 2013 13:49:58 GMT+0300 (IDT)
date.at("Hong Kong") // Fri May 17 2013 04:49:58 GMT+0300 (IDT)

get the available timezones ( with UTC offset )

Date.availableTimezones() 
/*
{
  International Date Line West: -39600,
  Midway Island: -39600,
  American Samoa: -39600,
  Hawaii: -36000,
  Alaska: -28800
  Abu Dhabi: 14400
  Adelaide: 34200
  ....
}
*/

to get the full list execute $ rake time:zones:all