diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-17 21:28:43 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-17 21:28:43 -0500 |
commit | b2ba07b90c11b4645a7ae4310e8422c8d5f62f35 (patch) | |
tree | df89710da788bea1200e0a8dceda34c2e8128482 /src/value.cc | |
parent | 6b557f810e1c6eb2dcd8a24eeeacfcf9cc8210e3 (diff) | |
download | fork-ledger-b2ba07b90c11b4645a7ae4310e8422c8d5f62f35.tar.gz fork-ledger-b2ba07b90c11b4645a7ae4310e8422c8d5f62f35.tar.bz2 fork-ledger-b2ba07b90c11b4645a7ae4310e8422c8d5f62f35.zip |
Fixed several time and date duration type uses
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/value.cc b/src/value.cc index 3f70ab3d..797c144c 100644 --- a/src/value.cc +++ b/src/value.cc @@ -338,10 +338,13 @@ value_t& value_t::operator+=(const value_t& val) case DATETIME: switch (val.type()) { case INTEGER: - as_datetime_lval() += date_duration(val.as_long()); + as_datetime_lval() += + time_duration_t(0, 0, static_cast<time_duration_t::sec_type>(val.as_long())); return *this; case AMOUNT: - as_datetime_lval() += date_duration(val.as_amount().to_long()); + as_datetime_lval() += + time_duration_t(0, 0, static_cast<time_duration_t::sec_type> + (val.as_amount().to_long())); return *this; default: break; @@ -351,10 +354,10 @@ value_t& value_t::operator+=(const value_t& val) case DATE: switch (val.type()) { case INTEGER: - as_date_lval() += date_duration_t(val.as_long()); + as_date_lval() += gregorian::date_duration(val.as_long()); return *this; case AMOUNT: - as_date_lval() += date_duration_t(val.as_amount().to_long()); + as_date_lval() += gregorian::date_duration(val.as_amount().to_long()); return *this; default: break; @@ -466,10 +469,13 @@ value_t& value_t::operator-=(const value_t& val) case DATETIME: switch (val.type()) { case INTEGER: - as_datetime_lval() -= date_duration(val.as_long()); + as_datetime_lval() -= + time_duration_t(0, 0, static_cast<time_duration_t::sec_type>(val.as_long())); return *this; case AMOUNT: - as_datetime_lval() -= date_duration(val.as_amount().to_long()); + as_datetime_lval() -= + time_duration_t(0, 0, static_cast<time_duration_t::sec_type> + (val.as_amount().to_long())); return *this; default: break; @@ -479,10 +485,10 @@ value_t& value_t::operator-=(const value_t& val) case DATE: switch (val.type()) { case INTEGER: - as_date_lval() -= date_duration_t(val.as_long()); + as_date_lval() -= gregorian::date_duration(val.as_long()); return *this; case AMOUNT: - as_date_lval() -= date_duration_t(val.as_amount().to_long()); + as_date_lval() -= gregorian::date_duration(val.as_amount().to_long()); return *this; default: break; |