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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5e4d68eaf0bbf171ed11bafb5a6f51ad945e1e8b2621f68b73989aed3effb3f
4
- data.tar.gz: 66e44d8391f704b6628509b3c6804b84aa6385ae4dce5de6981f192e45c61848
3
+ metadata.gz: 7e159af46f59f20e48137d90de0dbc30e41163cf0a790a0c398f8dd1cbde528c
4
+ data.tar.gz: 46dd6830341e2df50d96edf63b0429babbb7a9db6e63516d436364800c6eec45
5
5
  SHA512:
6
- metadata.gz: 1116606d9b2ae209667420e97c9e1914d0bd39be05c338b48ce2a87293d4d7f739be3aed80f1569c121d122798e8f147acf8968583432f4464828460d1ae3d76
7
- data.tar.gz: 2f8d1ff547861da38db93242e6a91e5256d0c542b5c13de0b97b389c59488f04bcb6c16a7d0aafa766dbd8258a6dbc3c31fcd1d1807a6327db9dba89b605927f
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicTimeZone
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.2'
5
5
  end
@@ -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.1
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