From ba1c0133819f1b01d3eb604df95ccf2a6c59b3c7 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 15 Apr 2024 09:42:05 +0200 Subject: [PATCH] #13344 minor fix --- .../godmode/users/configure_token.php | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/users/configure_token.php b/pandora_console/godmode/users/configure_token.php index bfbe699653..18e11d9603 100644 --- a/pandora_console/godmode/users/configure_token.php +++ b/pandora_console/godmode/users/configure_token.php @@ -202,21 +202,34 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript }); }); + function errordate() { + confirmDialog({ + title: "", + message: "", + hideCancelButton: true, + }); + } + $('#button-next').on('click', function() { event.preventDefault(); var date = $('#text-date-expiration').val(); var time = date+' '+$('#text-time-expiration').val(); - if (date !== '' || time !== '') { + if (date !== '' && $('#text-time-expiration').val() !== '') { if (date < $('#hidden-today_date').val() || time < $('#hidden-today_date').val()+' '+$('#hidden-today_time').val()) { - confirmDialog({ - title: "", - message: "", - hideCancelButton: true, - }); + console.log("ENTRO AQUI"); + errordate(); } else{ $('#form_token').submit(); } - } else { + } else if (date !== '' && time === ' ') { + if (date < $('#hidden-today_date').val()) { + errordate(); + } else{ + $('#form_token').submit(); + } + } else if (date === '' && time !== ' ') { + errordate(); + }else { $('#form_token').submit(); } })