mirror of
https://github.com/node-red/node-red
synced 2024-11-21 15:43:16 +00:00
Ensure trigger second output is revaluated for date types
This commit is contained in:
parent
b3aff3a3e6
commit
2220956007
@ -201,7 +201,7 @@ module.exports = function(RED) {
|
|||||||
if (node.op2type !== "nul") {
|
if (node.op2type !== "nul") {
|
||||||
var promise = Promise.resolve();
|
var promise = Promise.resolve();
|
||||||
msg2 = RED.util.cloneMessage(msg);
|
msg2 = RED.util.cloneMessage(msg);
|
||||||
if (node.op2type === "flow" || node.op2type === "global") {
|
if (node.op2type === "flow" || node.op2type === "global" || node.op2type === "date") {
|
||||||
promise = new Promise((resolve,reject) => {
|
promise = new Promise((resolve,reject) => {
|
||||||
RED.util.evaluateNodeProperty(node.op2,node.op2type,node,msg,(err,value) => {
|
RED.util.evaluateNodeProperty(node.op2,node.op2type,node,msg,(err,value) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -152,7 +152,7 @@ describe('trigger node', function() {
|
|||||||
if (rval) {
|
if (rval) {
|
||||||
msg.should.have.property("payload");
|
msg.should.have.property("payload");
|
||||||
if (type == "date" && val == "0") {
|
if (type == "date" && val == "0") {
|
||||||
should.deepEqual(Math.round(msg.payload/1000000), parseInt(Date.now()/1000000));
|
;(Math.round(msg.payload/1000000)).should.be.approximately(parseInt(Date.now()/1000000), 1);
|
||||||
}
|
}
|
||||||
else if (type == "date" && val == "iso") {
|
else if (type == "date" && val == "iso") {
|
||||||
should.deepEqual(msg.payload.substr(0,11), rval.substr(0,11));
|
should.deepEqual(msg.payload.substr(0,11), rval.substr(0,11));
|
||||||
|
Loading…
Reference in New Issue
Block a user