- for (j = NEW_YR; j >= NEW_DAY; j--) {
- if (new_date(dive, &last_dive, j, &dive_date))
- {
- gtk_tree_store_append(treestore, &parent_iter[j], parents[j+1]);
- parents[j] = &parent_iter[j];
- gtk_tree_store_set(treestore, parents[j],
- DIVE_INDEX, -j,
- DIVE_NR, -j,
- DIVE_DATE, dive_date,
- DIVE_LOCATION, "",
- DIVE_TEMPERATURE, 0,
- DIVE_SAC, 0,
+ if (new_group(dive, &last_dive, &dive_date))
+ {
+ /* make sure we display the first date of the trip in previous summary */
+ if (first_trip_dive && last_trip_dive && last_trip_dive->when < first_trip_dive->when)
+ gtk_tree_store_set(treestore, &parent_iter,
+ DIVE_DATE, last_trip_dive->when,
+ DIVE_LOCATION, last_trip_dive->location,