mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 13:15:35 +00:00
fix(race-manager): consider missing start and end date of event
This commit is contained in:
+6
-5
@@ -1,6 +1,5 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.raceinfo;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
@@ -138,12 +137,14 @@ public class StartTimeFragment extends BaseFragment
|
||||
final Serializable id = mDataStore.getEventUUID();
|
||||
if (id != null) {
|
||||
mEvent = mDataStore.getEvent(id);
|
||||
if (calendar.before(mEvent.getStartDate().asDate())) {
|
||||
final TimePoint startDate = mEvent.getStartDate();
|
||||
final TimePoint endDate = mEvent.getEndDate();
|
||||
if (startDate != null && calendar.before(startDate.asDate())) {
|
||||
//Today is before the start date of the event
|
||||
calendar.setTime(mEvent.getStartDate().asDate());
|
||||
} else if (calendar.after(mEvent.getEndDate().asDate())) {
|
||||
calendar.setTime(startDate.asDate());
|
||||
} else if (endDate != null && calendar.after(endDate.asDate())) {
|
||||
//Today is after the end date of the event
|
||||
calendar.setTime(mEvent.getEndDate().asDate());
|
||||
calendar.setTime(endDate.asDate());
|
||||
}
|
||||
}
|
||||
mStartTime = new MillisecondsTimePoint(calendar.getTime());
|
||||
|
||||
Reference in New Issue
Block a user