Core: remove "when" field of struct dive_trip

The when field gives the time of the first dive. Instead of keeping
this field in sync, replace it by a function that determines the time
of the first dive.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-11 13:09:51 +01:00 committed by Dirk Hohndel
parent 431b2bb845
commit 64e6e435f8
11 changed files with 23 additions and 52 deletions

View file

@ -956,7 +956,7 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o
}
/* Create the date-based hierarchy */
utc_mkdate(trip ? trip->when : dive->when, &tm);
utc_mkdate(trip ? trip_date(trip) : dive->when, &tm);
tree = mktree(repo, root, "%04d", tm.tm_year);
tree = mktree(repo, tree, "%02d", tm.tm_mon + 1);