From eeb52b22b8c0423f461d0d855c20f849b09efb16 Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Wed, 13 Oct 2021 16:05:35 +0200 Subject: [PATCH] B #5572: Fix schedule actions Sunstone recommended time (#1522) --- .../public/app/utils/schedule_action.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/sunstone/public/app/utils/schedule_action.js b/src/sunstone/public/app/utils/schedule_action.js index 45cc74815f..6f84dd4154 100644 --- a/src/sunstone/public/app/utils/schedule_action.js +++ b/src/sunstone/public/app/utils/schedule_action.js @@ -44,7 +44,13 @@ define(function (require) { CONSTANTS */ var CONFIRM_DIALOG_LEASES = require("utils/dialogs/leases/dialogId"); - 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 defaultActions = [ "terminate", @@ -84,7 +90,7 @@ define(function (require) { var options_date_picker={ dateFormat: "yy-mm-dd", - minDate: new Date(), + minDate: currentDate, showOptions: { direction: "down" } }; @@ -221,10 +227,9 @@ define(function (require) { } function _setup(context) { - var today = new Date(); - var dd = today.getDate(); - var mm = today.getMonth() + 1; - var yyyy = today.getFullYear(); + var dd = newDate.getDate(); + var mm = newDate.getMonth() + 1; + var yyyy = newDate.getFullYear(); if (dd < 10) { dd = "0" + dd; }