Hi all,
I recently discovered that $moment()
function is available in Jsonata expression.This is great to have it there.I stumbled upon an issue though and hope you may lend me a hand.
I am trying to subtract a variable duration from a date. The function signature in momentjs should be
moment(date).subtract(value,string).format("x")
when I do the same thing in Jsonata expression I cannot provide the chained function , that is subtract
any variables. It works only if I hard coded the values
that is it does not work if I try
$moment(msg.payload).subtract(msg.somevalue,msg.aduration).format("x")
it works only if
$moment(msg.payload).subtract(1,"w").format("x")
so my question is : is it something I am doing wrong, or is it that chained methods are unsupported by the Jsonata function in node-red?
I am not really sure how does node-red add functions to the Jsonata library of functions..
@janvda
thank you