diff --git a/web/public/js/components/common/datepicker.js b/web/public/js/components/common/datepicker.js index bc8b4095..9ed59ee1 100644 --- a/web/public/js/components/common/datepicker.js +++ b/web/public/js/components/common/datepicker.js @@ -38,6 +38,13 @@ Vue.component("datepicker", { watch: { value: function (v) { this.day = v + + let picker = this.$refs.dayInput.picker + if (picker != null) { + if (v != null && /^\d+-\d+-\d+$/.test(v)) { + picker.setDate(v) + } + } } }, methods: { diff --git a/web/public/js/utils.js b/web/public/js/utils.js index 25d25425..5605bdd7 100644 --- a/web/public/js/utils.js +++ b/web/public/js/utils.js @@ -85,7 +85,6 @@ window.teaweb = { return } - if (typeof (element) == "string") { element = document.getElementById(element); } @@ -112,6 +111,8 @@ window.teaweb = { }, reposition: !bottomLeft }) + + element.picker = picker }, formatBytes: function (bytes) { bytes = Math.ceil(bytes);