diff --git a/ChangeLog b/ChangeLog index 61dafff56..ba5c32c1a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ $Source$ * import.php: Correctly report that file could not be read. * libraries/import/sql.php: Fix handling of whitespace at the end of imported file. + * calendar.php, libraries/tbl_change.js: Calendar improvements: add submit + button (bug# 1312373) and fix entering time begining with 0 (bug + #1312373). 2005-10-05 Marc Delisle * db_details_structure.php, tbl_properties_table_info.php: detect diff --git a/calendar.php b/calendar.php index 51607b2f7..b009d783e 100644 --- a/calendar.php +++ b/calendar.php @@ -58,6 +58,7 @@ if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) { diff --git a/libraries/tbl_change.js b/libraries/tbl_change.js index 14d5dd02d..beeb14838 100644 --- a/libraries/tbl_change.js +++ b/libraries/tbl_change.js @@ -95,6 +95,7 @@ function openCalendar(params, form, field, type) { * Formats number to two digits. * * @param int number to format. + * @param string type of number */ function formatNum2(i, valtype) { f = (i < 10 ? '0' : '') + i; @@ -123,12 +124,26 @@ function formatNum2(i, valtype) { return f; } +/** + * Formats number to two digits. + * + * @param int number to format. + * @param int default value + * @param string type of number + */ +function formatNum2d(i, default_v, valtype) { + i = parseInt(i, 10); + if (isNaN(i)) return default_v; + return formatNum2(i, valtype) +} + /** * Formats number to four digits. * * @param int number to format. */ function formatNum4(i) { + i = parseInt(i, 10) return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i; } @@ -251,12 +266,13 @@ function initCalendar() { dispmonth = 1 + month; if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') { - actVal = formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day'); + actVal = "" + formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day'); } else { actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day'); } if (i == day) { style = ' class="selected"'; + current_date = actVal; } else { style = ''; } @@ -281,10 +297,15 @@ function initCalendar() { } str = ''; - str += '
'; - str += ':'; - str += ':'; - str += ''; + init_hour = hour; + init_minute = minute; + init_second = second; + str += ''; + str += ':'; + str += ':'; + str += ''; + str += '
'; + str += ''; str += '
'; cnt.innerHTML = str;