opening_hours_converter 1.4.3 → 1.4.4

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: 9585065385f691f52c4a58480b885bb00b6ee14f
4
- data.tar.gz: 5e5c2d66d29008132a7cce0dd3f21a302685c49b
3
+ metadata.gz: 51910f5b1ad844e6dd0389e0543f5fcec9de91a5
4
+ data.tar.gz: acdac6e0de9c5ea000f48f9ea8d18675c724d00f
5
5
  SHA512:
6
- metadata.gz: 6b3095cd996a5c744e040a5de0f2c4f6b4fb4528084931e2320eb48bab738f2130ba98a4f0ec933748424983d8faa2cd12b07e33fd44d2ee6ef701295fd3c15a
7
- data.tar.gz: c274827835fd504f17a7a74c51523c168d3be5de3b9a95717b2eb20221c7fd5e79075c39cfe0065521504e8214131fed17d8bb77745440864eef7c2c8b88e04b
6
+ metadata.gz: ecaa948f5f328f760038fb8d604b07972e7787a0378cc29ac2f766591a4da8cf29c1babba14e9075fa412e263ae33fe929c0f109729b0230206ce0b35d2e5920
7
+ data.tar.gz: afcd55214ec201a091a5608fcb838d468b5005af049d67638208d8b1c06294235f6b14f9180a236ed9e9666c31924a961cf8b0157f983686d6b1051946b7e56b
@@ -107,6 +107,7 @@ module OpeningHoursConverter
107
107
  end
108
108
 
109
109
  result = ""
110
+
110
111
  if rules.length == 0
111
112
 
112
113
  date_ranges.each do |dr|
@@ -73,7 +73,8 @@ module OpeningHoursConverter
73
73
  if day_bool && month_start < 0
74
74
  month_start = month
75
75
  day_start = day
76
- elsif day_bool && month_start >= 0 && month == 11 && day == 30
76
+ end
77
+ if day_bool && month_start >= 0 && month == 11 && day == 30
77
78
  result["always"] ||= []
78
79
  result["always"] << {start: { day: day_start, month: month_start }, end: { day: 30, month: 11 }}
79
80
  month_start = -1
@@ -161,7 +162,11 @@ module OpeningHoursConverter
161
162
  elsif starts_month?(interval) && ends_month?(interval)
162
163
  str_result += "#{OSM_MONTHS[interval[:start][:month]]}-#{OSM_MONTHS[interval[:end][:month]]}"
163
164
  elsif is_same_month?(interval)
164
- str_result += "#{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}"
165
+ if is_same_day?(interval)
166
+ str_result += "#{OSM_MONTHS[interval[:start][:month]]} #{interval[:start][:day]+1 < 10 ? "0#{interval[:start][:day]+1}" : interval[:start][:day]+1}"
167
+ else
168
+ str_result += "#{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}"
169
+ end
165
170
  else
166
171
  str_result += "#{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}"
167
172
  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.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin