Hi,
I have this very, very simple javascript code in my workflow:
var now = get_ym_now();
var prev = get_ym_diff(now,-1);
'Now' has the value 202410 (Oct 2024).
The last lines of the function get_ym_now() are:
const ym = year*100 + month;
return ym;
So the return value is a number.
Typeof now returns this:
The function get_ym_diff calculates the year-month 1 month earlier: 202409.
When I use get_ym_diff(202410,-1), the result is 202409. Correct.
But when I use get_ym_diff(now,-1) it returns a null value.
Both functions are in the list of functions here:
Adding now = parseInt(now); didn't help.
What am I doing wrong here?