diff --git a/src/sunstone/public/app/utils/schedule_action.js b/src/sunstone/public/app/utils/schedule_action.js index 6f84dd4154..654034f8ce 100644 --- a/src/sunstone/public/app/utils/schedule_action.js +++ b/src/sunstone/public/app/utils/schedule_action.js @@ -662,8 +662,7 @@ define(function (require) { } end_type = 2; var timeCal = date_input_value + " " + time_input_value; - epochStr = new Date(timeCal); - var time = parseInt(epochStr.getTime(),10) / 1000; + var time = dateToEpoch(new Date(timeCal)) sched_action.END_TYPE = end_type; sched_action.END_VALUE = time; sched_action.TIME = time; @@ -707,8 +706,7 @@ define(function (require) { return false; } var time_value = end_date + " 12:00"; - var epoch_str = new Date(time_value); - end_value = parseInt(epoch_str.getTime()) / 1000; + end_value = dateToEpoch(new Date(time_value)) } sched_action.DAYS = String(days); sched_action.REPEAT = String(rep); @@ -1167,7 +1165,8 @@ define(function (require) { * @returns {string} - HTML string with the json keys and values */ function _getScheduleActionTableContent(actions_array, template={}) { - scheduleActionsArray = actions_array || []; + var sched_actions = Array.isArray(actions_array) ? actions_array : [actions_array]; + scheduleActionsArray = sched_actions ? sched_actions : []; var empty = "\