summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-11 21:32:18 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-11 21:32:32 -0500
commit67c9cf134d1403657c766e72b96d692a7d538f65 (patch)
treecd72247ddf240746b524c8fecf6d10f8667b37e4 /src/item.h
parentc22b8457eff27f5227fdf452e036b33e41e229c2 (diff)
downloadfork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.tar.gz
fork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.tar.bz2
fork-ledger-67c9cf134d1403657c766e72b96d692a7d538f65.zip
Added --date, similar to --account and --payee
This lets you do things like store a date as the value of a tag, then run: ledger --date='has_tag("Foo") ? to_date(tag("Foo")) : date' reg
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/item.h b/src/item.h
index 84385eb7..13332f0b 100644
--- a/src/item.h
+++ b/src/item.h
@@ -172,6 +172,12 @@ public:
virtual optional<date_t> effective_date() const {
return _date_eff;
}
+ virtual void set_date(const date_t& date) {
+ if (use_effective_date)
+ _date_eff = date;
+ else
+ _date = date;
+ }
void set_state(state_t new_state) {
_state = new_state;