opening_hours_converter 1.6.1 → 1.6.2

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: d0ad64a12cda6b180b7ab2a4a6d9e7aacf712b73
4
- data.tar.gz: efb6a8c5930dc03ff1346813208df516b550ad38
3
+ metadata.gz: 842c8f590c509cb332f29ebd42d006a426c724ab
4
+ data.tar.gz: 860f0b96385bc61f27727efe5bb332ff4fb6d537
5
5
  SHA512:
6
- metadata.gz: 82c5844c495b9489de4202439c2ffcb7d3fdd5bad1f7d8a8e49c4a56b1e466ea62a3676455f4608c5fe12bc5dacf0c8905635afec76cde44ec7490dd93d748eb
7
- data.tar.gz: 35b64100a3ac4b10a194190f07ad64e6c9060a0fabae4a1048e23d6ec25dd48f5b93bfcf36a09fd8afdbef832cc453d130ae6ac87ea79d775a62e11038c00f91
6
+ metadata.gz: f5e2c1e2929cc7eb853f1acf2f9583d07a2fdc75fdd68067bc5450805d4e7ca753652c0cfb9baa2ba16e13f33fac24d16e986a1035632283fabcb86a9f4987e3
7
+ data.tar.gz: 921e5977a9f7cf2377bc0cb727e07951bc51399344737585b26baef2dc2f980f47fa3d14a82ae81d829fb893fc4bbf598ff1b1ed113b5c901644cce231e8e25a
@@ -37,7 +37,7 @@ module OpeningHoursConverter
37
37
  if month == 0
38
38
  end_res = DateTime.new(year-1, 12, 31)
39
39
  else
40
- end_res = DateTime.new(year, month, MONTH_END_DAY[month])
40
+ end_res = DateTime.new(year, month, MONTH_END_DAY[month-1])
41
41
  end
42
42
  else
43
43
 
@@ -14,6 +14,7 @@ module OpeningHoursConverter
14
14
 
15
15
  def get
16
16
  result = ""
17
+
17
18
  if @date.length > 0
18
19
  result += get_wide_selector
19
20
  end
@@ -122,18 +122,43 @@ module OpeningHoursConverter
122
122
  years["always"][wide_interval.start[:month]-1][day] = true
123
123
  end
124
124
  elsif wide_interval.start[:month] != wide_interval.end[:month]
125
- for month in wide_interval.start[:month]-1..wide_interval.end[:month]-1
126
- if month == wide_interval.start[:month]-1
127
- for day in wide_interval.start[:day]-1...MONTH_END_DAY[month]
128
- years["always"][month][day] = true
125
+ if wide_interval.end[:month] < wide_interval.start[:month]
126
+ for month in wide_interval.start[:month]-1..11
127
+ if month == wide_interval.start[:month]-1
128
+ for day in wide_interval.start[:day]-1...MONTH_END_DAY[month]
129
+ years["always"][month][day] = true
130
+ end
131
+ else
132
+ for day in 0...MONTH_END_DAY[month]
133
+ years["always"][month][day] = true
134
+ end
129
135
  end
130
- elsif month == wide_interval.end[:month]-1
131
- for day in 0..wide_interval.end[:day]-1
132
- years["always"][month][day] = true
136
+ end
137
+ for month in 0..wide_interval.end[:month]-1
138
+ if month == wide_interval.end[:month]-1
139
+ for day in 0..wide_interval.end[:day]-1
140
+ years["always"][month][day] = true
141
+ end
142
+ else
143
+ for day in 0...MONTH_END_DAY[month]
144
+ years["always"][month][day] = true
145
+ end
133
146
  end
134
- else
135
- for day in 0...MONTH_END_DAY[month]
136
- years["always"][month][day] = true
147
+ end
148
+ else
149
+ for month in wide_interval.start[:month]-1..wide_interval.end[:month]-1
150
+ if month == wide_interval.start[:month]-1
151
+ for day in wide_interval.start[:day]-1...MONTH_END_DAY[month]
152
+ years["always"][month][day] = true
153
+ end
154
+ elsif month == wide_interval.end[:month]-1
155
+ for day in 0..wide_interval.end[:day]-1
156
+ years["always"][month][day] = true
157
+ end
158
+ else
159
+ for day in 0...MONTH_END_DAY[month]
160
+ years["always"][month][day] = true
161
+ end
137
162
  end
138
163
  end
139
164
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_hours_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-27 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json