From ce18bc8d1a3bddfcda2f942c0e4f893458dc2cad Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Wed, 13 Oct 2021 16:05:53 +0200 Subject: [PATCH] B #5572: Fix schedule actions Sunstone recommended time (#1521) (cherry picked from commit 46909d707b31c354053c428c54ceba6ade0cdbdd) --- src/sunstone/public/app/utils/schedule_action.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/utils/schedule_action.js b/src/sunstone/public/app/utils/schedule_action.js index 6beee558d3..5cf746f2d9 100644 --- a/src/sunstone/public/app/utils/schedule_action.js +++ b/src/sunstone/public/app/utils/schedule_action.js @@ -26,7 +26,13 @@ define(function (require) { var TemplateTableHTML = require("hbs!./schedule_action/table"); var selector = ''; - var defaultHour = "12:30"; + var currentDate = new Date(); + var newDate = new Date(); + // if you want to add more time to the schedule action modify this + // variable + var hours = 1; + newDate.setTime(currentDate.getTime() + (hours*60*60*1000)); + var defaultHour = newDate.getHours() + ":" + newDate.getMinutes(); var actionsWithARGS = [ 'snapshot-create', 'snapshot-revert', @@ -81,7 +87,7 @@ define(function (require) { var options_date_picker={ dateFormat: "yy-mm-dd", - minDate: new Date(), + minDate: currentDate, showOptions: { direction: "down" } }; var options_hour_picker = {