Calendar improvements: add submit button (bug# 1312373) and fix entering time begining with 0 (bug #1312373).
This commit is contained in:
@@ -9,6 +9,9 @@ $Source$
|
|||||||
* import.php: Correctly report that file could not be read.
|
* import.php: Correctly report that file could not be read.
|
||||||
* libraries/import/sql.php: Fix handling of whitespace at the end of
|
* libraries/import/sql.php: Fix handling of whitespace at the end of
|
||||||
imported file.
|
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 <lem9@users.sourceforge.net>
|
2005-10-05 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* db_details_structure.php, tbl_properties_table_info.php: detect
|
* db_details_structure.php, tbl_properties_table_info.php: detect
|
||||||
|
@@ -58,6 +58,7 @@ if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) {
|
|||||||
<!--
|
<!--
|
||||||
var month_names = new Array("<?php echo implode('","', $month); ?>");
|
var month_names = new Array("<?php echo implode('","', $month); ?>");
|
||||||
var day_names = new Array("<?php echo implode('","', $day_of_week); ?>");
|
var day_names = new Array("<?php echo implode('","', $day_of_week); ?>");
|
||||||
|
var submit_text = "<?php echo $strGo; ?>";
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@@ -95,6 +95,7 @@ function openCalendar(params, form, field, type) {
|
|||||||
* Formats number to two digits.
|
* Formats number to two digits.
|
||||||
*
|
*
|
||||||
* @param int number to format.
|
* @param int number to format.
|
||||||
|
* @param string type of number
|
||||||
*/
|
*/
|
||||||
function formatNum2(i, valtype) {
|
function formatNum2(i, valtype) {
|
||||||
f = (i < 10 ? '0' : '') + i;
|
f = (i < 10 ? '0' : '') + i;
|
||||||
@@ -123,12 +124,26 @@ function formatNum2(i, valtype) {
|
|||||||
return f;
|
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.
|
* Formats number to four digits.
|
||||||
*
|
*
|
||||||
* @param int number to format.
|
* @param int number to format.
|
||||||
*/
|
*/
|
||||||
function formatNum4(i) {
|
function formatNum4(i) {
|
||||||
|
i = parseInt(i, 10)
|
||||||
return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;
|
return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,12 +266,13 @@ function initCalendar() {
|
|||||||
dispmonth = 1 + month;
|
dispmonth = 1 + month;
|
||||||
|
|
||||||
if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') {
|
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 {
|
} else {
|
||||||
actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day');
|
actVal = "" + formatNum4(year) + formatNum2(dispmonth, 'month') + formatNum2(i, 'day');
|
||||||
}
|
}
|
||||||
if (i == day) {
|
if (i == day) {
|
||||||
style = ' class="selected"';
|
style = ' class="selected"';
|
||||||
|
current_date = actVal;
|
||||||
} else {
|
} else {
|
||||||
style = '';
|
style = '';
|
||||||
}
|
}
|
||||||
@@ -281,10 +297,15 @@ function initCalendar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
str = '';
|
str = '';
|
||||||
str += '<form class="clock">';
|
init_hour = hour;
|
||||||
str += '<input id="hour" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'hour\')" value="' + formatNum2(hour, 'hour') + '" />:';
|
init_minute = minute;
|
||||||
str += '<input id="minute" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'minute\')" value="' + formatNum2(minute, 'minute') + '" />:';
|
init_second = second;
|
||||||
str += '<input id="second" type="text" size="2" maxlength="2" onblur="this.value=formatNum2(this.value, \'second\')" value="' + formatNum2(second, 'second') + '" />';
|
str += '<form method="NONE" class="clock" onsubmit="returnDate(\'' + current_date + '\')">';
|
||||||
|
str += '<input id="hour" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_hour, \'hour\'); init_hour = this.value;" value="' + formatNum2(hour, 'hour') + '" />:';
|
||||||
|
str += '<input id="minute" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_minute, \'minute\'); init_minute = this.value;" value="' + formatNum2(minute, 'minute') + '" />:';
|
||||||
|
str += '<input id="second" type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_second, \'second\'); init_second = this.value;" value="' + formatNum2(second, 'second') + '" />';
|
||||||
|
str += '<br />';
|
||||||
|
str += '<input type="submit" value="' + submit_text + '"/>';
|
||||||
str += '</form>';
|
str += '</form>';
|
||||||
|
|
||||||
cnt.innerHTML = str;
|
cnt.innerHTML = str;
|
||||||
|
Reference in New Issue
Block a user