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 <me@mohdluqman.com>
This commit is contained in:
mohdluqman 2017-06-28 15:42:18 +05:30 committed by Michal Čihař
parent 153fefb52b
commit 32af52a858

View File

@ -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')) {