Skip to content

Commit

Permalink
Add time64 functions for gncEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
limitedAtonement authored and christopherlam committed Jan 8, 2018
1 parent dbd1473 commit 0bf0989
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libgnucash/engine/gncEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,11 @@ Timespec gncEntryGetDate (const GncEntry *entry)
return entry->date;
}

time64 gncEntryGetDateTT (const GncEntry *entry)
{
return entry ? entry->date.tv_sec : 0;
}

GDate gncEntryGetDateGDate(const GncEntry *entry)
{
return timespec_to_gdate(gncEntryGetDate(entry));
Expand All @@ -898,6 +903,11 @@ Timespec gncEntryGetDateEntered (const GncEntry *entry)
return entry->date_entered;
}

time64 gncEntryGetDateEnteredTT (const GncEntry *entry)
{
return entry ? entry->date_entered.tv_sec : 0;
}

const char * gncEntryGetDescription (const GncEntry *entry)
{
if (!entry) return NULL;
Expand Down
2 changes: 2 additions & 0 deletions libgnucash/engine/gncEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ is a misleading extra information. We are only dealing with the day
information! */
Timespec gncEntryGetDate (const GncEntry *entry);
Timespec gncEntryGetDateEntered (const GncEntry *entry);
time64 gncEntryGetDateTT (const GncEntry *entry);
time64 gncEntryGetDateEnteredTT (const GncEntry *entry);
const char * gncEntryGetDescription (const GncEntry *entry);
const char * gncEntryGetAction (const GncEntry *entry);
const char * gncEntryGetNotes (const GncEntry *notes);
Expand Down

0 comments on commit 0bf0989

Please sign in to comment.