diff --git a/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs b/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs index 05b609f68de..35036e89155 100644 --- a/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs +++ b/app/assets/javascripts/discourse/app/components/relative-time-picker.gjs @@ -125,7 +125,7 @@ export default class RelativeTimePicker extends Component { } calculateMinutes(duration, interval) { - if (isBlank(duration)) { + if (isBlank(duration) || isNaN(duration)) { return null; } diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs index 4fcdd31f057..59eca912c75 100644 --- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs +++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.hbs @@ -41,6 +41,7 @@ diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js index 36923b5d92c..e361a6ec13e 100644 --- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js +++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js @@ -52,6 +52,7 @@ export default Component.extend({ selectedDate: null, selectedDatetime: null, prefilledDatetime: null, + selectedDurationMins: null, hiddenOptions: null, customOptions: null, @@ -208,7 +209,10 @@ export default Component.extend({ relativeTimeChanged(relativeTimeMins) { let dateTime = now(this.userTimezone).add(relativeTimeMins, "minutes"); - this.set("selectedDatetime", dateTime); + this.setProperties({ + selectedDurationMins: relativeTimeMins, + selectedDatetime: dateTime, + }); if (this.onTimeSelected) { this.onTimeSelected(TIME_SHORTCUT_TYPES.RELATIVE, dateTime);