dynamic_time_zone 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamic_time_zone/date_patch.rb +13 -0
- data/lib/dynamic_time_zone/version.rb +1 -1
- data/lib/dynamic_time_zone.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e159af46f59f20e48137d90de0dbc30e41163cf0a790a0c398f8dd1cbde528c
|
4
|
+
data.tar.gz: 46dd6830341e2df50d96edf63b0429babbb7a9db6e63516d436364800c6eec45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc860e1965cf496fc683cb4a627ef06cd531a1d191425e2e1fa4140b549d2b23d4a549f57565c699bc28957080a236ffcd6c088558233ea1df2c960216a7da8
|
7
|
+
data.tar.gz: f9f7294ea3ee58f85822856f7e06df1575764fa8ff138fe1c62f54eaa42b98ed71c2371f7b5110aa2279109db63afeab45464706fe3928b949089151940514ba
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DatePatch
|
4
|
+
def current
|
5
|
+
# Normally, Date.current ends up calling Time.zone.now which ends up passing the
|
6
|
+
# dynamic zone offset to Time which can raises out of range error. Here, we attempt
|
7
|
+
# to avoid that by grabbing the date out of time (which already works correctly with
|
8
|
+
# dynaminc time zones).
|
9
|
+
Time.current.to_date
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Date.singleton_class.prepend(DatePatch)
|
data/lib/dynamic_time_zone.rb
CHANGED
@@ -23,6 +23,7 @@ require 'dynamic_time_zone/validator'
|
|
23
23
|
require 'dynamic_time_zone/identifier_builder'
|
24
24
|
require 'dynamic_time_zone/time_zone_data_source'
|
25
25
|
require 'dynamic_time_zone/time_with_zone_patch'
|
26
|
+
require 'dynamic_time_zone/date_patch'
|
26
27
|
require 'dynamic_time_zone/time_patch'
|
27
28
|
require 'dynamic_time_zone/offset_format_convertor'
|
28
29
|
require 'dynamic_time_zone/time_parser'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_time_zone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appfolio
|
@@ -71,6 +71,7 @@ extensions: []
|
|
71
71
|
extra_rdoc_files: []
|
72
72
|
files:
|
73
73
|
- lib/dynamic_time_zone.rb
|
74
|
+
- lib/dynamic_time_zone/date_patch.rb
|
74
75
|
- lib/dynamic_time_zone/identifier_builder.rb
|
75
76
|
- lib/dynamic_time_zone/offset_format_convertor.rb
|
76
77
|
- lib/dynamic_time_zone/test_helper.rb
|