summaryrefslogtreecommitdiff
path: root/src/post.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/post.cc')
-rw-r--r--src/post.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/post.cc b/src/post.cc
index 3a0f3cc4..9b416434 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -244,6 +244,10 @@ namespace {
return long(post.reported_account()->depth);
}
+ value_t get_datetime(post_t& post) {
+ return post.xdata().datetime;
+ }
+
template <value_t (*Func)(post_t&)>
value_t get_wrapper(call_scope_t& scope) {
return (*Func)(find_scope<post_t>(scope));
@@ -282,6 +286,8 @@ expr_t::ptr_op_t post_t::lookup(const string& name)
case 'd':
if (name == "depth")
return WRAP_FUNCTOR(get_wrapper<&get_account_depth>);
+ else if (name == "datetime")
+ return WRAP_FUNCTOR(get_wrapper<&get_datetime>);
break;
case 'h':
@@ -296,6 +302,8 @@ expr_t::ptr_op_t post_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_payee>);
else if (name == "primary")
return WRAP_FUNCTOR(get_wrapper<&get_commodity_is_primary>);
+ else if (name == "parent")
+ return WRAP_FUNCTOR(get_wrapper<&get_xact>);
break;
case 'r':