diff --git a/ui/src/Components/SilenceModal/DateTimeSelect/index.js b/ui/src/Components/SilenceModal/DateTimeSelect/index.js index a87452add..6c4905fca 100644 --- a/ui/src/Components/SilenceModal/DateTimeSelect/index.js +++ b/ui/src/Components/SilenceModal/DateTimeSelect/index.js @@ -83,6 +83,16 @@ const TabContentEnd = observer(({ silenceFormStore }) => { ); }); +// calculate value for duration increase and decrease buttons using a goal step +const CalculateChangeValue = (currentValue, step) => { + // if current value is less than step (but >0) then use 1 + if (currentValue > 0 && currentValue < step) { + return 1; + } + // otherwise use step or a value that moves current value to the next step + return step - (currentValue % step) || step; +}; + const TabContentDuration = observer(({ silenceFormStore }) => { return (