Skip to content

Commit

Permalink
Update to picker min date after from date is picked
Browse files Browse the repository at this point in the history
  • Loading branch information
pgiraud committed Dec 15, 2020
1 parent 6b4c8e8 commit 5a6a61b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions temboardui/plugins/monitoring/static/js/daterangepicker.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,20 @@
}
}

function setToPickerMinDate() {
$(this.$el).find('[data-role=to-picker]').daterangepicker(
$.extend({
minDate: dateMath.parse(this.inputFrom)
}, pickerOptions),
onPickerApply.bind(this, 'inputTo')
);
}

function onPickerApply(targetProperty, date) {
this[targetProperty] = date;
if (targetProperty === 'inputFrom') {
setToPickerMinDate.call(this);
}
}

function refresh() {
Expand Down

0 comments on commit 5a6a61b

Please sign in to comment.