opening_hours_converter 1.13.0 → 1.13.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: 0e14bfa479d2bea81a625afc37b44c032f2ecfbea62218002592f0efb79d25c3
4
- data.tar.gz: 301201253cf8495de144f0509a49052733b7cd55a2583e994088c179b5e57260
3
+ metadata.gz: eea3348ad8b93b702b1e932b2be1b7e8134bf40613d12d1f7b14922bfd5a4b8f
4
+ data.tar.gz: 7ecdd6c41d2aa1cb977401b381f30344674edd9c327b74bc882902415d7630ec
5
5
  SHA512:
6
- metadata.gz: 007507ee2cb8438b64e5fb8d6e142680ed2b99eb979a64f1b6b69f8e16f6053140cf4b9b07522b8d2dae8cbc557428d85e3a37e786d29bf6687f70c1c03b4871
7
- data.tar.gz: cf8467a7b1623b9884ba530c8df2a58bcabbb78c1bef48e1e95dc1801c47191c64723ed75685b3377f9f0045d934f66264d232207c45bbffc275b87f4892d9f4
6
+ metadata.gz: 40b00f35eb69fc9631d87cf0a34e067c2ba0fe0d163beef982c955b03a9c744d1f609e6241e3c08554bc7a54c86351dcb042160b2b84a5367cc626f81bd80856
7
+ data.tar.gz: bf04a34d12472137d017f9f0359bdd476068faf4a0978123c283cc4118cd3a917b9205acd7528baa7d0f7b2ef36da66f711d21314acf5e631728f5a454651abf
@@ -67,6 +67,7 @@ module OpeningHoursConverter
67
67
  date_ranges.each do |dr|
68
68
  is_ph = true if dr.is_holiday?
69
69
  end
70
+
70
71
  date_ranges_array = get_iterator(date_ranges)
71
72
  datetime_result = []
72
73
 
@@ -79,9 +80,12 @@ module OpeningHoursConverter
79
80
  end
80
81
  date_ranges[index].typical.intervals.each do |i|
81
82
  next unless !i.nil? && !i.is_off
82
- next unless (i.day_start..i.day_end).cover?(reindex_sunday_week_to_monday_week(day.wday)) || (is_ph && year_ph.include?(Time.new(day.year, day.month, day.day)))
83
- itr = { start: Time.new(day.year, day.month, day.day, i.start / 60, i.start % 60),
84
- end: Time.new(day.year, day.month, day.day, i.end / 60, i.end % 60) }
83
+
84
+ if date_ranges[index].typical.is_a? Week
85
+ next unless (i.day_start..i.day_end).cover?(reindex_sunday_week_to_monday_week(day.wday)) || (is_ph && year_ph.include?(Time.new(day.year, day.month, day.day)))
86
+ end
87
+
88
+ itr = { start: Time.new(day.year, day.month, day.day, i.start / 60, i.start % 60), end: Time.new(day.year, day.month, day.day, i.end / 60, i.end % 60) }
85
89
  datetime_result << itr unless datetime_result.include?(itr)
86
90
  end
87
91
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_hours_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2019-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json