X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=statistics.c;h=ee3a5b22031e9221de9b346b89f187558931f00b;hb=0089dd8819b7b28ad5c48dbfc881f4011f18014e;hp=bf37bf85e01c489ae374e00a7b12f52cadae224a;hpb=d906c82f31c5406b6debe0df88cb49b916cd6ced;p=ext%2Fsubsurface.git diff --git a/statistics.c b/statistics.c index bf37bf8..ee3a5b2 100644 --- a/statistics.c +++ b/statistics.c @@ -125,10 +125,18 @@ void show_dive_stats(struct dive *dive) const char *unit; int idx, offset, gas_used; struct dive *prev_dive; + struct tm *tm; process_all_dives(dive, &prev_dive); - strftime(buf, 80, "%a, %b %d, %Y, %k:%M", gmtime(&dive->when)); + tm = gmtime(&dive->when); + snprintf(buf, sizeof(buf), + "%s, %s %d, %d %2d:%02d", + weekday(tm->tm_wday), + monthname(tm->tm_mon), + tm->tm_mday, tm->tm_year + 1900, + tm->tm_hour, tm->tm_min); + set_label(info_stat_w.date, buf); set_label(info_stat_w.dive_time, "%d min", (dive->duration.seconds + 30) / 60); if (prev_dive) @@ -140,7 +148,7 @@ void show_dive_stats(struct dive *dive) set_label(info_stat_w.max_depth, "%.*f %s", decimals, value, unit); value = get_depth_units(dive->meandepth.mm, &decimals, &unit); set_label(info_stat_w.avg_depth, "%.*f %s", decimals, value, unit); - if (dive->watertemp.mkelvin > 200) { + if (dive->watertemp.mkelvin) { value = get_temp_units(dive->watertemp.mkelvin, &unit); set_label(info_stat_w.water_temp, "%.1f %s", value, unit); } else