I had a moment node to up my google home to cast a weather function I built. The moment node would give me today's date in the format of "Friday March the 8th" and the names of the next 5 days for the forecast. I updated some nodes (probably moment) and it disappeared. The only solution I have found so far is in a function node as follows;
// $now([picture [, timezone]])
const data = {
// example1: "[M01]/[D01]/[Y0001] [h#1]:[m01][P]",
example1: "[FNn] [MNn] the [D1o]",
example2: "[H01]:[m01]:[s01] [z]",
example3: "-0600",
};
// Generates a UTC timestamp in ISO 8601 compatible format and returns it as a string
// If the optional picture and timezone parameters are supplied,
// then the current timestamp is formatted as described by the $fromMillis() function
const expression = [
jsonata("$now()"),
jsonata("$now(example1, example3)"),
jsonata("$now(example2, example3)"),
];
msg.payload = [
// expression[0].evaluate(data),
expression[1].evaluate(data),
// expression[2].evaluate(data),
];
return msg;
This is only for today's date, and I don't know how to get this into the global context, or how to add days to this.
Any help would be appreciated.