mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-09 22:01:02 +00:00
Stage Countdown - Stop countdown when zero date is reached
This commit is contained in:
1 parent
7a904e9f3d
commit
8098cdbcaa
1 file changed
+4
+4
@@ -5,6 +5,7 @@ import com.google.gwt.user.client.Timer;
|
||||
import com.sap.sailing.gwt.common.client.i18n.TextMessages;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
/**
|
||||
@@ -120,6 +121,9 @@ public class Countdown {
|
||||
|
||||
private void update() {
|
||||
Duration diff = MillisecondsTimePoint.now().until(zeroDate);
|
||||
if (diff.asMillis() < 0) {
|
||||
diff = new MillisecondsDurationImpl(0);
|
||||
}
|
||||
double asDays = diff.asDays();
|
||||
long wholeDaysRemaining = (long) asDays;
|
||||
double asHours = diff.asHours();
|
||||
|
||||
Reference in new issue
Block a user