opening_hours_converter 1.3.11 → 1.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opening_hours_converter/opening_hours_parser.rb +15 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f468692db741b2e791f1d07c77e3bec3e33834d
|
4
|
+
data.tar.gz: bfca0d4c43a2289e81e86ca6e61da95a8cae06e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b5fd9166b85dca915151fd37f76e8bbe5f232e6be53521befbf9f84c3b8e14f17152a07362ee21340cf3d929e61f703967672a0cb6e3ae31e0c4d08a68d6781
|
7
|
+
data.tar.gz: 711baa863a46bfa94dc5d842df3e0a3b699ff50e4229c9182214d1fd8b0c309f0f08350b12b4eea9677dcf2d0a6cb4f896170d76a15c24fe344805f986df16dd
|
@@ -248,7 +248,7 @@ module OpeningHoursConverter
|
|
248
248
|
|
249
249
|
for t_id in 0...times.length
|
250
250
|
if rule_modifier == "closed" || rule_modifier == "off"
|
251
|
-
remove_interval(dr_obj
|
251
|
+
remove_interval(dr_obj, weekdays[wd_id], times[t_id])
|
252
252
|
else
|
253
253
|
add_interval(dr_obj.typical, weekdays[wd_id], times[t_id])
|
254
254
|
end
|
@@ -436,17 +436,21 @@ module OpeningHoursConverter
|
|
436
436
|
{ weekdays: weekdays, holidays: holidays }
|
437
437
|
end
|
438
438
|
|
439
|
-
def remove_interval(
|
440
|
-
if
|
441
|
-
|
442
|
-
typical.remove_intervals_during_day(wd)
|
443
|
-
end
|
439
|
+
def remove_interval(date_range, weekdays, times)
|
440
|
+
if date_range.typical.instance_of?(OpeningHoursConverter::Day)
|
441
|
+
date_range.typical.clear_intervals
|
444
442
|
else
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
443
|
+
if weekdays[:from] <= weekdays[:to]
|
444
|
+
for wd in weekdays[:from]..weekdays[:to]
|
445
|
+
date_range.typical.remove_intervals_during_day(wd)
|
446
|
+
end
|
447
|
+
else
|
448
|
+
for wd in weekdays[:from]..6
|
449
|
+
date_range.typical.remove_intervals_during_day(wd)
|
450
|
+
end
|
451
|
+
for wd in 0..weekdays[:to]
|
452
|
+
date_range.typical.remove_intervals_during_day(wd)
|
453
|
+
end
|
450
454
|
end
|
451
455
|
end
|
452
456
|
end
|