opening_hours_converter 1.4.12 → 1.4.13
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 +5 -5
- 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: 06ce9d47aedbd6214a4569f1b6da79da7b220932
|
4
|
+
data.tar.gz: 030e18c02f49842eb3941be10e646dfc72216805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cc1a7ddd9c4036cee74091c148a04b2f381cd5b9e51eb0c5e789bfa0dcb25907e1b5f620e39b36706c701b5c8dd2d44321f4503b390d77d165e546e09386627
|
7
|
+
data.tar.gz: 38e45642d03eea097e5ff967fb746bbd98d559f8352f970444d8011dadcc524ef638a910522a81119ca442661a343d688c68085346cbbf8b503a40f7c34943f9
|
@@ -263,7 +263,7 @@ module OpeningHoursConverter
|
|
263
263
|
|
264
264
|
def from_json(json)
|
265
265
|
parsed = JSON.parse(json)
|
266
|
-
date_range =
|
266
|
+
date_range = []
|
267
267
|
parsed.each do |dr|
|
268
268
|
wi = {}
|
269
269
|
start_day = DateTime.parse(dr["wide_interval"]["start"])
|
@@ -274,17 +274,17 @@ module OpeningHoursConverter
|
|
274
274
|
else
|
275
275
|
wi = OpeningHoursConverter::WideInterval.new.day(start_day.day, start_day.month, start_day.year, end_day.day, end_day.month, end_day.year)
|
276
276
|
end
|
277
|
-
date_range
|
277
|
+
date_range << OpeningHoursConverter::DateRange.new(wi)
|
278
|
+
date_range.last.add_comment(dr["comment"])
|
278
279
|
dr["typical"]["intervals"].each do |interval|
|
279
280
|
if !interval.nil?
|
280
281
|
start_interval = DateTime.parse(interval["start"])
|
281
282
|
end_interval = DateTime.parse(interval["end"])
|
282
|
-
date_range.typical.add_interval(OpeningHoursConverter::Interval.new(((start_interval.wday + 6) % 7), (start_interval.hour * 60 + start_interval.min), ((end_interval.wday + 6) % 7), (end_interval.hour * 60 + end_interval.min)))
|
283
|
+
date_range.last.typical.add_interval(OpeningHoursConverter::Interval.new(((start_interval.wday + 6) % 7), (start_interval.hour * 60 + start_interval.min), ((end_interval.wday + 6) % 7), (end_interval.hour * 60 + end_interval.min)))
|
283
284
|
end
|
284
285
|
end
|
285
|
-
date_range.add_comment(dr["comment"])
|
286
286
|
end
|
287
|
-
|
287
|
+
date_range
|
288
288
|
end
|
289
289
|
|
290
290
|
def get_year(wrs)
|