summaryrefslogtreecommitdiff
path: root/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 22:23:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 22:23:14 -0400
commit41e8d1871e067656c6df03edf49bee6d8ae9f02c (patch)
treee4d2ca17ed3b03882f49a85f257cbf2616d04f65 /value.cc
parent3d1ab0e4e7ebf87d811572e43ef0dda42696a0d4 (diff)
downloadfork-ledger-41e8d1871e067656c6df03edf49bee6d8ae9f02c.tar.gz
fork-ledger-41e8d1871e067656c6df03edf49bee6d8ae9f02c.tar.bz2
fork-ledger-41e8d1871e067656c6df03edf49bee6d8ae9f02c.zip
Changes to allow DATETIME values to be negated, for the purposes of reverse
sorting.
Diffstat (limited to 'value.cc')
-rw-r--r--value.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/value.cc b/value.cc
index 641beb49..1ced0b96 100644
--- a/value.cc
+++ b/value.cc
@@ -1067,7 +1067,9 @@ void value_t::negate()
*((long *) data) = - *((long *) data);
break;
case DATETIME:
- throw new value_error("Cannot negate a date/time");
+ cast(INTEGER);
+ negate();
+ break;
case AMOUNT:
((amount_t *) data)->negate();
break;