Commit 3f10a652 authored by Francesco Lucchi's avatar Francesco Lucchi
Browse files

Fix management of missing end date

parent 44740216
......@@ -18,13 +18,15 @@ angular.module('cron_frequency', [ 'ngMaterial','sbiModule','angular_time_picker
frequency.startDate = frequency.startDate.getTime();
frequency.startTime = "";
if(!angular.isDate(frequency.endDate)){
frequency.endDate = new Date(frequency.endDate);
if(frequency.endDate){
if(!angular.isDate(frequency.endDate)){
frequency.endDate = new Date(frequency.endDate);
}
var hoursAndMinutes = frequency.endTime.split(":");
frequency.endDate.setHours(hoursAndMinutes[0]);
frequency.endDate.setMinutes(hoursAndMinutes[1]);
frequency.endDate = frequency.endDate.getTime();
}
var hoursAndMinutes = frequency.endTime.split(":");
frequency.endDate.setHours(hoursAndMinutes[0]);
frequency.endDate.setMinutes(hoursAndMinutes[1]);
frequency.endDate = frequency.endDate.getTime();
frequency.endTime = "";
frequency.cron=JSON.stringify(frequency.cron);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment