From 69f65956a9e8eff01da7a24724cfad7bc9a6435f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 10 Apr 2023 10:52:37 +0200 Subject: [PATCH] [ticket/17100] Move onchange for date select to admin ajax.js PHPBB3-17100 --- phpBB/adm/style/ajax.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index d1007d0173..5949c73920 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -340,6 +340,19 @@ $(function() { }); } + // Handle date option changes + const dateoptionSelect = document.getElementById('dateoptions'); + if (dateoptionSelect) { + dateoptionSelect.addEventListener('change', function() { + const dateoptionInput = document.getElementById(this.getAttribute('data-dateoption')); + if (this.value === 'custom') { + dateoptionInput.value = this.getAttribute('data-dateoption-default'); + } else { + dateoptionInput.value = this.value; + } + }) + } + if ($('#acp_help_phpbb')) { phpbb.prepareSendStats(); }