Commit 11ae6eb334fdeaae67f89dbcdfb6f16d3d469b30
1 parent
0abc95ca
Exists in
master
Correção de cálculo de data
Showing
2 changed files
with
9 additions
and
6 deletions
Show diff stats
cit-core/src/main/java/br/com/centralit/framework/model/WorkDay.java
... | ... | @@ -150,7 +150,7 @@ public class WorkDay extends PersistentObjectAudit{ |
150 | 150 | * @return |
151 | 151 | */ |
152 | 152 | public long[] startTimeToArray() { |
153 | - if (this.getWorkTimes() == null) | |
153 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
154 | 154 | return new long[0]; |
155 | 155 | |
156 | 156 | long[] array = new long[this.getWorkTimes().size()]; |
... | ... | @@ -172,7 +172,7 @@ public class WorkDay extends PersistentObjectAudit{ |
172 | 172 | * @return |
173 | 173 | */ |
174 | 174 | public long[] endTimeToArray() { |
175 | - if (this.getWorkTimes() == null) | |
175 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
176 | 176 | return new long[0]; |
177 | 177 | |
178 | 178 | long[] array = new long[this.getWorkTimes().size()]; |
... | ... | @@ -245,7 +245,7 @@ public class WorkDay extends PersistentObjectAudit{ |
245 | 245 | * @return |
246 | 246 | */ |
247 | 247 | public long getEndWorkTime() { |
248 | - if (this.getWorkTimes() == null) | |
248 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
249 | 249 | return 0; |
250 | 250 | |
251 | 251 | final long[] endArray = this.endTimeToArray(); |
... | ... | @@ -260,7 +260,7 @@ public class WorkDay extends PersistentObjectAudit{ |
260 | 260 | * @return |
261 | 261 | */ |
262 | 262 | public long getStartWorkTime() { |
263 | - if (this.getWorkTimes() == null) | |
263 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
264 | 264 | return 0; |
265 | 265 | |
266 | 266 | final long[] startArray = this.startTimeToArray(); |
... | ... | @@ -275,7 +275,7 @@ public class WorkDay extends PersistentObjectAudit{ |
275 | 275 | * @return |
276 | 276 | */ |
277 | 277 | public long calculateIntervals(final long startTime, final long endTime) { |
278 | - if (this.getWorkTimes() == null) | |
278 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
279 | 279 | return 0; |
280 | 280 | |
281 | 281 | long interval = 0; |
... | ... | @@ -333,7 +333,7 @@ public class WorkDay extends PersistentObjectAudit{ |
333 | 333 | * @return |
334 | 334 | */ |
335 | 335 | public long getNextEndWorkTime(final long timeRef) { |
336 | - if (this.getWorkTimes() == null) | |
336 | + if (this.getWorkTimes() == null || this.getWorkTimes().size() == 0) | |
337 | 337 | return 0; |
338 | 338 | |
339 | 339 | final long[] endArray = this.endTimeToArray(); | ... | ... |
cit-core/src/main/java/br/com/centralit/framework/util/UtilDate.java