diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-16 03:44:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-16 03:44:27 -0400 |
commit | f1523b5464924bf9d9987fce0cb3dbe4acda5a4b (patch) | |
tree | 4e968c574a1c84bbf23493b57bfe61e4ac852cf7 /src/times.h | |
parent | f2c60057ef20ae7138caaac4911f4b12cdc81002 (diff) | |
download | fork-ledger-f1523b5464924bf9d9987fce0cb3dbe4acda5a4b.tar.gz fork-ledger-f1523b5464924bf9d9987fce0cb3dbe4acda5a4b.tar.bz2 fork-ledger-f1523b5464924bf9d9987fce0cb3dbe4acda5a4b.zip |
The new code is working now.
Diffstat (limited to 'src/times.h')
-rw-r--r-- | src/times.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/times.h b/src/times.h index eb58a97f..9750bbfb 100644 --- a/src/times.h +++ b/src/times.h @@ -155,6 +155,7 @@ public: } date_interval_t(const date_interval_t& other) : start(other.start), + aligned(other.aligned), skip_duration(other.skip_duration), factor(other.factor), next(other.next), @@ -193,10 +194,13 @@ public: /** Find the current or next period containing date. Returns true if the date_interval_t object has been altered to reflect the interval containing date, or false if no such period can be found. */ - bool find_period(const date_t& date, date_interval_t * last_interval = NULL); + bool find_period(const date_t& date); - date_t inclusive_end() const { - return *end_of_duration - gregorian::days(1); + optional<date_t> inclusive_end() const { + if (end_of_duration) + return *end_of_duration - gregorian::days(1); + else + return none; } date_interval_t& operator++(); |