mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add timestamp as a default typedInput
and update Inject and change nodes to match, and add some tests.
This commit is contained in:
@@ -242,7 +242,7 @@
|
||||
$("#node-input-payload").typedInput({
|
||||
default: 'str',
|
||||
typeField: $("#node-input-payloadType"),
|
||||
types:['flow','global','str','num','bool','json',{value:"date",label:this._("inject.timestamp"),hasValue:false}]
|
||||
types:['flow','global','str','num','bool','json','date']
|
||||
});
|
||||
|
||||
$("#inject-time-type-select").change(function() {
|
||||
|
@@ -46,7 +46,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
if (this.once) {
|
||||
setTimeout( function(){ node.emit("input",{}); }, 100);
|
||||
setTimeout( function() { node.emit("input",{}); }, 100 );
|
||||
}
|
||||
|
||||
this.on("input",function(msg) {
|
||||
|
@@ -206,10 +206,10 @@ module.exports = function(RED) {
|
||||
}
|
||||
});
|
||||
this.on("close", function() {
|
||||
while(node.outstandingTimers.length > 0) {
|
||||
while (node.outstandingTimers.length > 0) {
|
||||
clearTimeout(node.outstandingTimers.pop())
|
||||
}
|
||||
while(node.outstandingIntervals.length > 0) {
|
||||
while (node.outstandingIntervals.length > 0) {
|
||||
clearInterval(node.outstandingIntervals.pop())
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user