browser-timezone-rails 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36c61f0b3e6e456a8a3eefac77a68240d0ee7539
|
4
|
+
data.tar.gz: 69cff59ce807a41d32ccfb647b97282f63ff6ac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eec1e70450da61a3273f07f0cba82fb12578eaaf219101725cb14f6ec90d3f2f36c2e4e5e47aa4c4bb44d1fa8c94a0247bf1952b27305829be1595b70a887745
|
7
|
+
data.tar.gz: 0f1ac70a00b969cdde3964d05799f60474f2f99f5b193ede00241e0fc048250c1bfe69d75b68aea5b2d3c70f4bbe373cfdd00db4c73d65bd7cae1e7517c7a2da
|
data/README.md
CHANGED
@@ -16,14 +16,19 @@ gem 'browser-timezone-rails'
|
|
16
16
|
Make sure you have each of the following entries in your application.js:
|
17
17
|
```
|
18
18
|
//= require js.cookie
|
19
|
-
//= require jstz
|
20
19
|
//= require browser_timezone_rails/set_time_zone
|
21
20
|
```
|
22
21
|
That's it! No other configuration is needed as it's all done for you with this gem including setting up your application controller to start using your users' zones.
|
23
22
|
|
24
23
|
## How it works
|
25
24
|
|
26
|
-
The
|
25
|
+
The browser's timezone is set in a cookie using the modern [ECMAScript Internationalization API](https://www.ecma-international.org/ecma-402/)
|
26
|
+
|
27
|
+
Caveat: doesn't work with Internet Explorer.
|
28
|
+
|
29
|
+
(Up to 1.0.4 version of the gem, the cookie was set via the [jsTimezoneDetect](https://bitbucket.org/pellepim/jstimezonedetect) javascript library, which, however, was often inaccurate.)
|
30
|
+
|
31
|
+
That cookie is then read during each request to set the Rails timezone for that user.
|
27
32
|
|
28
33
|
You can also read more about this implementation here: [Blog](http://cowjumpedoverthecommodore64.blogspot.in/2013/03/setting-rails-timezone-to-users.html)
|
29
34
|
|
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'browser-timezone-rails/engine'
|
4
4
|
require 'js_cookie_rails'
|
5
|
-
require 'jstz-rails'
|
6
5
|
|
7
6
|
module BrowserTimezoneRails
|
8
|
-
PREPEND_METHOD = if Rails::VERSION::MAJOR == 3 || (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR
|
7
|
+
PREPEND_METHOD = if Rails::VERSION::MAJOR == 3 || (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR < 2)
|
9
8
|
:prepend_around_filter
|
10
9
|
else
|
11
10
|
:prepend_around_action
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browser-timezone-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kbaum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: jstz-rails3-plus
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec-rails
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|