opening_hours_converter 1.3.8 → 1.3.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f59f13fa2cdc370c95156630a9789e52ebb3a2
|
4
|
+
data.tar.gz: ea7af1b0b5e99e622fb179b6e4c0da4dd6059436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40af9709076c5302ff46b25226ff8ff6173129263522cf031d9f79c59a4643fe13e7d84f3cf943d591f04bd4bc56a4756bd50051306ed636302f77d387227c57
|
7
|
+
data.tar.gz: a44404b688eeeb156b0e7f228b855efc7d27a1088b16181d2e4973c03c4ce83880a59cd88ccaa283273cd27655c8cd1d391ef1ac1c7ea43239fd704c8519d476
|
@@ -99,7 +99,8 @@ module OpeningHoursConverter
|
|
99
99
|
year_start = year
|
100
100
|
month_start = month
|
101
101
|
day_start = day
|
102
|
-
|
102
|
+
end
|
103
|
+
if day_bool && year_start >= 0 && month == 11 && day == 30 && years[year+1].nil?
|
103
104
|
if year_start == year
|
104
105
|
result[year] ||= []
|
105
106
|
result[year] << { start: { day: day_start, month: month_start }, end: { day: 30, month: 11 } }
|
@@ -142,6 +143,7 @@ module OpeningHoursConverter
|
|
142
143
|
end
|
143
144
|
end
|
144
145
|
end
|
146
|
+
|
145
147
|
result_to_string(result)
|
146
148
|
end
|
147
149
|
|
@@ -188,7 +190,11 @@ module OpeningHoursConverter
|
|
188
190
|
elsif starts_month?(interval) && ends_month?(interval)
|
189
191
|
str_result += "#{str_result.length > 5 ? "," : ""}#{OSM_MONTHS[interval[:start][:month]]}-#{OSM_MONTHS[interval[:end][:month]]}"
|
190
192
|
elsif is_same_month?(interval)
|
191
|
-
|
193
|
+
if is_same_day?(interval)
|
194
|
+
str_result += "#{str_result.length > 5 ? "," : ""}#{OSM_MONTHS[interval[:start][:month]]} #{interval[:start][:day]+1 < 10 ? "0#{interval[:start][:day]+1}" : interval[:start][:day]+1}"
|
195
|
+
else
|
196
|
+
str_result += "#{str_result.length > 5 ? "," : ""}#{OSM_MONTHS[interval[:start][:month]]} #{interval[:start][:day]+1 < 10 ? "0#{interval[:start][:day]+1}" : interval[:start][:day]+1}-#{interval[:end][:day]+1 < 10 ? "0#{interval[:end][:day]+1}" : interval[:end][:day]+1}"
|
197
|
+
end
|
192
198
|
else
|
193
199
|
str_result += "#{str_result.length > 5 ? "," : ""}#{OSM_MONTHS[interval[:start][:month]]} #{interval[:start][:day]+1 < 10 ? "0#{interval[:start][:day]+1}" : interval[:start][:day]+1}-#{OSM_MONTHS[interval[:end][:month]]} #{interval[:end][:day]+1 < 10 ? "0#{interval[:end][:day]+1}" : interval[:end][:day]+1}"
|
194
200
|
end
|
@@ -215,6 +221,10 @@ module OpeningHoursConverter
|
|
215
221
|
r[:start][:month] == r[:end][:month]
|
216
222
|
end
|
217
223
|
|
224
|
+
def is_same_day?(r)
|
225
|
+
r[:start][:day] == r[:end][:day]
|
226
|
+
end
|
227
|
+
|
218
228
|
def starts_month?(r)
|
219
229
|
r[:start][:day] == 0
|
220
230
|
end
|