Fixed caledar behavior for DATE fields.

This commit is contained in:
Michal Čihař
2004-04-18 09:03:14 +00:00
parent de1a6dafe6
commit b11947f775
2 changed files with 5 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-04-18 Michal Cihar <michal@cihar.com>
* libraries/tbl_change.js: Fixed caledar behavior for DATE fields.
2004-04-18 Alexander M. Turek <me@derrabus.de> 2004-04-18 Alexander M. Turek <me@derrabus.de>
* lang/german-*.inc.php: Updates. * lang/german-*.inc.php: Updates.

View File

@@ -138,7 +138,7 @@ function initCalendar() {
/* Called for first time */ /* Called for first time */
if (window.opener.dateField.value) { if (window.opener.dateField.value) {
value = window.opener.dateField.value; value = window.opener.dateField.value;
if (window.opener.type == 'date') { if (window.opener.dateType == 'date') {
date = value.split("-"); date = value.split("-");
day = parseInt(date[2]); day = parseInt(date[2]);
month = parseInt(date[1]) - 1; month = parseInt(date[1]) - 1;
@@ -195,7 +195,7 @@ function initCalendar() {
dayInWeek = 0; dayInWeek = 0;
} }
dispmonth = 1 + month; dispmonth = 1 + month;
if (window.opener.type == 'date') { if (window.opener.dateType == 'date') {
actVal = year + "-" + dispmonth + "-" + i; actVal = year + "-" + dispmonth + "-" + i;
} else { } else {
actVal = "" + (year < 1000 ? year < 100 ? year < 10 ? '000' : '00' : '0' : '') + year + (dispmonth < 10 ? '0' : '') + dispmonth + (i < 10 ? '0' : '') + i; actVal = "" + (year < 1000 ? year < 100 ? year < 10 ? '000' : '00' : '0' : '') + year + (dispmonth < 10 ? '0' : '') + dispmonth + (i < 10 ? '0' : '') + i;