opening_hours_converter 1.7.3 → 1.7.4
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/wide_interval.rb +15 -2
- 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: d86fe1aa14a6ac56a0bdac562323672d2032b2fa
|
4
|
+
data.tar.gz: d70a925a60170967c50150c5e4ac7016f7b8f3ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7441d6f58bf6b85293e2e8ba9a1510089fcd1ab0f339ade09b291c3ab9a09245ddc5717f42cf0eaa6fb887404cfc1d0e01ad62fe93d7ebec69a617364b4feefe
|
7
|
+
data.tar.gz: f66495e7b07a9371fcc5cee21aeeff41dcf756e52b8ca974b5a815f2aa6de882e4de945df3044e9a6fd642329f4692a1534de4b3d90c2eec2e7a30306b838842
|
@@ -475,6 +475,7 @@ module OpeningHoursConverter
|
|
475
475
|
end
|
476
476
|
|
477
477
|
def width
|
478
|
+
return Float::INFINITY if @type == "always"
|
478
479
|
in_day = to_day
|
479
480
|
days_count = 0
|
480
481
|
if in_day.end
|
@@ -505,12 +506,24 @@ module OpeningHoursConverter
|
|
505
506
|
end
|
506
507
|
else
|
507
508
|
for month in in_day.start[:month]..in_day.end[:month]
|
508
|
-
|
509
|
+
if month == in_day.end[:month]
|
510
|
+
days_count += in_day.end[:day]
|
511
|
+
elsif month == in_day.start[:month]
|
512
|
+
days_count += MONTH_END_DAY[month - 1] - in_day.start[:day]
|
513
|
+
else
|
514
|
+
days_count += MONTH_END_DAY[month - 1]
|
515
|
+
end
|
509
516
|
end
|
510
517
|
end
|
511
518
|
else
|
512
519
|
for month in in_day.start[:month]..in_day.end[:month]
|
513
|
-
|
520
|
+
if month == in_day.end[:month]
|
521
|
+
days_count += in_day.end[:day]
|
522
|
+
elsif month == in_day.start[:month]
|
523
|
+
days_count += MONTH_END_DAY[month - 1] - in_day.start[:day]
|
524
|
+
else
|
525
|
+
days_count += MONTH_END_DAY[month - 1]
|
526
|
+
end
|
514
527
|
end
|
515
528
|
end
|
516
529
|
return days_count
|