mirror of
https://github.com/node-red/node-red
synced 2024-11-21 07:33:58 +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") {
|
||||
var promise = Promise.resolve();
|
||||
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) => {
|
||||
RED.util.evaluateNodeProperty(node.op2,node.op2type,node,msg,(err,value) => {
|
||||
if (err) {
|
||||
|
@ -152,7 +152,7 @@ describe('trigger node', function() {
|
||||
if (rval) {
|
||||
msg.should.have.property("payload");
|
||||
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") {
|
||||
should.deepEqual(msg.payload.substr(0,11), rval.substr(0,11));
|
||||
|
Loading…
Reference in New Issue
Block a user