1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Inject Node: Interval between times not sticking

fixes #67
This commit is contained in:
Nicholas O'Leary 2013-11-09 17:07:57 +00:00
parent a2e77471a9
commit 22f46a4317

View File

@ -202,7 +202,7 @@
}, },
oneditprepare: function() { oneditprepare: function() {
var repeattype = "none"; var repeattype = "none";
if (this.repeat != "") { if (this.repeat != "" && this.repeat != 0) {
repeattype = "interval"; repeattype = "interval";
$("#inject-time-interval-units option").filter(function() {return $(this).val() == "s";}).attr('selected',true); $("#inject-time-interval-units option").filter(function() {return $(this).val() == "s";}).attr('selected',true);
$("#inject-time-interval-count").val(this.repeat); $("#inject-time-interval-count").val(this.repeat);
@ -307,7 +307,7 @@
var timerange = ""; var timerange = "";
if (startTime == endTime) { if (startTime == endTime) {
//TODO: invalid //TODO: invalid
repeat = 0; repeat = "";
crontab = ""; crontab = "";
} else if (endTime == 0) { } else if (endTime == 0) {
timerange = startTime+"-23"; timerange = startTime+"-23";
@ -330,13 +330,13 @@
} }
timerange = startpart+","+endpart; timerange = startpart+","+endpart;
} }
repeat = 0; repeat = "";
crontab = "*/"+count+" "+timerange+" * * "+days; crontab = "*/"+count+" "+timerange+" * * "+days;
} else if (type == "time") { } else if (type == "time") {
var time = $("#inject-time-time").val(); var time = $("#inject-time-time").val();
var days = $("#inject-time-time-days option:selected").val(); var days = $("#inject-time-time-days option:selected").val();
var parts = time.split(":"); var parts = time.split(":");
repeat = 0; repeat = "";
crontab = parts[1]+" "+parts[0]+" * * "+days; crontab = parts[1]+" "+parts[0]+" * * "+days;
} }