Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-android
Commits
188fb42d
Commit
188fb42d
authored
Jan 10, 2017
by
Robert Hitt
Browse files
Fixed logic error in FacilityPresenter
parent
b63763c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/srct/whatsopen/presenters/FacilityPresenter.java
View file @
188fb42d
...
...
@@ -77,7 +77,7 @@ public class FacilityPresenter {
if
(
currentDay
<
openTimesList
.
size
())
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
try
{
Date
currentTime
=
sdf
.
parse
(
sdf
.
format
(
now
.
getTime
()
))
;
Date
currentTime
=
now
.
getTime
();
Date
startTime
=
sdf
.
parse
(
openTimesList
.
get
(
currentDay
).
getStartTime
());
if
(
currentTime
.
compareTo
(
startTime
)
<
0
)
{
...
...
@@ -100,7 +100,7 @@ public class FacilityPresenter {
String
openingTime
=
openTimesList
.
get
(
nextDay
).
getStartTime
();
openingTime
=
parseTo12HourTime
(
openingTime
);
durationMessage
=
"Opens on "
+
nextDayStr
+
" at "
+
openingTime
;
durationMessage
=
"Opens
next
on "
+
nextDayStr
+
" at "
+
openingTime
;
return
durationMessage
;
}
...
...
@@ -109,8 +109,10 @@ public class FacilityPresenter {
private
int
findNextDay
(
RealmList
<
OpenTimes
>
openTimesList
,
int
current
)
{
int
nextDay
=
openTimesList
.
first
().
getStartDay
();
for
(
OpenTimes
o
:
openTimesList
)
{
if
(
o
.
getStartDay
()
>
current
)
if
(
o
.
getStartDay
()
>
current
)
{
nextDay
=
o
.
getStartDay
();
break
;
}
}
return
nextDay
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment