Skip to content

Commit ca5790e

Browse files
committed
disable time in the past if minTime is specified
1 parent 3970a07 commit ca5790e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/javascript/app/components/time_picker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const TimePicker = (() => {
4848
(!options.maxTime || time_now.unix() !== options.maxTime.unix())) {
4949
options.minTime = time_now;
5050
}
51-
obj_config.minTime = { hour: parseInt(options.minTime.hour()), minute: parseInt(options.minTime.minute()) };
51+
obj_config.minTime = {
52+
hour : parseInt(options.minTime.local().hour()),
53+
minute: parseInt(options.minTime.local().minute()),
54+
};
5255
}
5356

5457
if (options.maxTime) {

src/javascript/app/pages/user/account/settings/self_exclusion.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ const SelfExclusion = (() => {
214214

215215
const initDatePicker = () => {
216216
// timeout_until
217-
TimePicker.init({ selector: timeout_time_id });
217+
TimePicker.init({
218+
selector: timeout_time_id,
219+
minTime : 'now',
220+
});
218221
DatePicker.init({
219222
selector: timeout_date_id,
220223
minDate : 0,

0 commit comments

Comments
 (0)