solidus_tec_estimator 1.0.0 → 1.0.1

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: e20f6f24520ff83d576c390de4cca09898690eb3bf43ddeec39621cb397c54bf
4
- data.tar.gz: 1adbd0fed447a36308d8904d7721e5a14dc395c13c391083f5f5945941b25f94
3
+ metadata.gz: e5e7cd13f4896e9a372dd9f05843b4740b416130570780457e1ee61bebde2c1a
4
+ data.tar.gz: 3194224d288d40fd74bf0f9ce1558f84219c92739ed506840b75c93be07334a4
5
5
  SHA512:
6
- metadata.gz: 10ee9a2204b71663480eb1eff72ab599c9af634f8f3beaa0bcf7d9bfe531e5828d661f66f9f1e3e0b41482b7ca1e5007cf5140299d24aad3b654939f72d7fa50
7
- data.tar.gz: 6755ea2795bbccdcbe1dc835ad2c2a988c30b5537587200952907762d672e1fd5ffeef722b3388e56eeedee67a24f7d884d3304a83585d8c8a093e6e23ee4b19
6
+ metadata.gz: 4fa22eb8ecc2a66ee4431e6ad34db0adbe12b7e9ceea0d528f73800ca6a3dda880dd1379e1df1840e420afa3bc5e9a40f43479586b81a23029843592acc64956
7
+ data.tar.gz: 3b7ad8dd88b055ff69d5c643cf47fb54feda8ec98769f651a3414e842e1fd662f529e55f1e7e9726289fd1996d0cbf167b74a7ed0bd8aa85f299a72f09e01c7c
@@ -38,15 +38,16 @@ module SolidusTecEstimator
38
38
  shipping_method.provider_id = SolidusTecEstimator::Provider.find_by(class_name: self.class.to_s).id
39
39
  end
40
40
 
41
- if Time.now < Time.now.change({hour: 16}) && Time.now.on_weekday?
42
- min_delivery_time = (Time.now + 30.minutes)
43
- max_delivery_time = (Time.now + 2.hours)
44
- elsif Time.now > Time.now.change({hour: 16}) && Time.now.next_day.on_weekday?
45
- min_delivery_time = Time.now.next_day.change({hour: 8})
46
- max_delivery_time = Time.now.next_day.change({hour: 10})
41
+ time_now = Time.now.in_time_zone('America/Sao_Paulo')
42
+ if time_now < time_now.change({hour: 16}) && time_now.on_weekday?
43
+ min_delivery_time = (time_now + 30.minutes)
44
+ max_delivery_time = (time_now + 2.hours)
45
+ elsif time_now > time_now.change({hour: 16}) && time_now.next_day.on_weekday?
46
+ min_delivery_time = time_now.next_day.change({hour: 8})
47
+ max_delivery_time = time_now.next_day.change({hour: 10})
47
48
  else
48
- min_delivery_time = Time.now.next_weekday.change({hour: 8})
49
- max_delivery_time = Time.now.next_weekday.change({hour: 10})
49
+ min_delivery_time = time_now.next_weekday.change({hour: 8})
50
+ max_delivery_time = time_now.next_weekday.change({hour: 10})
50
51
  end
51
52
 
52
53
  Spree::ShippingRate.new(
@@ -1,3 +1,3 @@
1
1
  module SolidusTecEstimator
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_tec_estimator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core