From 32af52a858ccf7fb6f51d2d1dce677779a444fae Mon Sep 17 00:00:00 2001 From: mohdluqman Date: Wed, 28 Jun 2017 15:42:18 +0530 Subject: [PATCH] Fixed time selection for TIME type (#13093) TIME type in MySql supports a long range of values. The PMA insert widget don't allow the values greater than 23 currently. So, it is corrected by setting the timepicker function have a greater hourMax value than it have by default. Fixes #12948 Signed-off-by: Mohammad Luqman --- js/functions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index dcc1f4de7a..84049cdbb3 100644 --- a/js/functions.js +++ b/js/functions.js @@ -171,6 +171,7 @@ function addDateTimePicker() { var showMillisec = false; var showMicrosec = false; var timeFormat = 'HH:mm:ss'; + var hourMax = 23; // check for decimal places of seconds if (decimals > 0 && type.indexOf('time') != -1){ if (decimals > 3) { @@ -182,12 +183,15 @@ function addDateTimePicker() { timeFormat = 'HH:mm:ss.l'; } } + if (type == 'time'){ + hourMax = 99; + } PMA_addDatepicker($(this), type, { showMillisec: showMillisec, showMicrosec: showMicrosec, - timeFormat: timeFormat + timeFormat: timeFormat, + hourMax: hourMax }); - // Add a tip regarding entering MySQL allowed-values // for TIME and DATE data-type if ($(this).hasClass('timefield')) {