dynamic_time_zone 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '086e49015eb839845d138706fa36e5f5389db097bf2612df00f7fe50ea1e9dd8'
4
- data.tar.gz: 9ca0f7741e769f1b679157744e3713737a982de3438a5e693b48d40b3edfbbc6
3
+ metadata.gz: 495fbed668267a932e1719e9877a9450c404baaadc892a5d7c36c8d9fcfef45c
4
+ data.tar.gz: 708f132cbc5da54b49d9793f44f2c03f3c128c66a403d9ecf4f2c6c02f91c5c7
5
5
  SHA512:
6
- metadata.gz: ecf0bdef79552069afce4a7bf669743679e3a64929ee858a10110b6d51d47b2c720f23cf767b86ac0352db5999322b584b7e78bb84b02d41060cfdc95683a46b
7
- data.tar.gz: 59c876b2e3d98c82d0afb28a873fdbaa60dd83206ecb1575e257af45f86caa3b52b12d57e82bb95a4c3cfc8cc996de0df1937feb8b492113e2dfe016c927725b
6
+ metadata.gz: 41c199f3d118993457c9886c25740048a5171392376c32be79707faf12b6cfcd2904475029fc92322c6cb75e84d3e8a2a0564f80e11b5557025698d37d46ff9d
7
+ data.tar.gz: 2235ee587f21a9dd92c64024e7c0cb87cd693fef9705dbda86ed3465c9ea099bb84152a84742ff33e89f7b9f506b320f5227b762c6fc63d47a43aafae5fcf9e1
@@ -9,7 +9,11 @@ module TimeWithZonePatch
9
9
  alias_method :getlocal, :localtime
10
10
 
11
11
  def formatted_offset(*args)
12
- using_dynamic_time_zone? ? '+0000' : super
12
+ actual_formatted_offset = super
13
+ return actual_formatted_offset unless using_dynamic_time_zone?
14
+
15
+ seconds_in_24_hours = 24 * 60 * 60
16
+ utc_offset.abs > seconds_in_24_hours ? '+0000' : actual_formatted_offset
13
17
  end
14
18
 
15
19
  def using_dynamic_time_zone?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicTimeZone
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_time_zone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appfolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.1.6
81
+ rubygems_version: 3.0.9
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Dynamically set the offset from UTC from timezone identifier