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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46ef423c9764ac700a75b88c7378b364f188eb51
4
- data.tar.gz: d585222584c77e64591b4b9b39fea3599f1a604f
3
+ metadata.gz: 4f468692db741b2e791f1d07c77e3bec3e33834d
4
+ data.tar.gz: bfca0d4c43a2289e81e86ca6e61da95a8cae06e6
5
5
  SHA512:
6
- metadata.gz: 19e9ee8257e85d7357eec971f4d73ae810822161754892525ee5ca92c8e62caa20b6fa845fc377221c16773d0185bfc8587d0262ee7eeafce3b4ee130d467ce4
7
- data.tar.gz: 91f7c17c74e2214ecb32b100e6c8f95449aa4ece19738a074c040c2dd678588c065bc0151e8f8fcd85f5f13de0ca5c3de79c54c79ccd77fd3662eb54c887d7f7
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.typical, weekdays[wd_id], times[t_id])
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(typical, weekdays, times)
440
- if weekdays[:from] <= weekdays[:to]
441
- for wd in weekdays[:from]..weekdays[:to]
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
- for wd in weekdays[:from]..6
446
- typical.remove_intervals_during_day(wd)
447
- end
448
- for wd in 0..weekdays[:to]
449
- typical.remove_intervals_during_day(wd)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_hours_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
4
+ version: 1.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin