]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Surface interval is calculated from the END of previous dive
authorDirk Hohndel <dirk@hohndel.org>
Wed, 2 Nov 2011 20:27:25 +0000 (13:27 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Wed, 2 Nov 2011 20:27:25 +0000 (13:27 -0700)
Silly mistake

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
statistics.c

index 845bc2a03d6ef7a669625d5bbab0bff0e2d484ef..56b04f283de79a9f38b29dd27d2171544a1f4e54 100644 (file)
@@ -132,7 +132,8 @@ void show_dive_stats(struct dive *dive)
        set_label(info_stat_w.date, buf);
        set_label(info_stat_w.dive_time, "%d min", (dive->duration.seconds + 30) / 60);
        if (prev_dive)
-               set_label(info_stat_w.surf_intv, get_time_string(dive->when - prev_dive->when, 4));
+               set_label(info_stat_w.surf_intv, 
+                       get_time_string(dive->when - (prev_dive->when + prev_dive->duration.seconds), 4));
        else
                set_label(info_stat_w.surf_intv, "unknown");
        value = get_depth_units(dive->maxdepth.mm, &decimals, &unit);