From f616254ef06c7ddbf633241cb49f01faac147aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 18 Apr 2004 10:03:16 +0000 Subject: [PATCH] Add support for DATETIME. --- ChangeLog | 2 ++ libraries/tbl_change.js | 27 +++++++++++++++++++++------ tbl_change.php | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 604d4ce6b..401293942 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2004-04-18 Michal Cihar * libraries/tbl_change.js: Fixed caledar behavior for DATE fields. + * libraries/auth/cookie.auth.lib.php: Fix LoginCookieValidity behaviour. + * libraries/tbl_change.js, tbl_change.php: Add support for DATETIME. 2004-04-18 Alexander M. Turek * lang/german-*.inc.php: Updates. diff --git a/libraries/tbl_change.js b/libraries/tbl_change.js index 014556272..8c3c8fc17 100644 --- a/libraries/tbl_change.js +++ b/libraries/tbl_change.js @@ -138,7 +138,7 @@ function initCalendar() { /* Called for first time */ if (window.opener.dateField.value) { value = window.opener.dateField.value; - if (window.opener.dateType == 'date') { + if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') { date = value.split("-"); day = parseInt(date[2]); month = parseInt(date[1]) - 1; @@ -157,8 +157,14 @@ function initCalendar() { } } else { /* Moving in calendar */ - if (month > 11) {month = 0; year++;} - if (month < 0) {month = 11; year--;} + if (month > 11) { + month = 0; + year++; + } + if (month < 0) { + month = 11; + year--; + } } if (document.getElementById) { @@ -170,8 +176,17 @@ function initCalendar() { cnt.innerHTML = ""; str = "" - - str += '
« ' + month_names[month] + ' »« ' + year + ' »
'; + + //heading table + str += '
'; + str += '« '; + str += month_names[month]; + str += ' »'; + str += ''; + str += '« '; + str += year; + str += ' »'; + str += '
'; str += ''; for (i = 0; i < 7; i++) { @@ -195,7 +210,7 @@ function initCalendar() { dayInWeek = 0; } dispmonth = 1 + month; - if (window.opener.dateType == 'date') { + if (window.opener.dateType == 'datetime' || window.opener.dateType == 'date') { actVal = year + "-" + dispmonth + "-" + i; } else { actVal = "" + (year < 1000 ? year < 100 ? year < 10 ? '000' : '00' : '0' : '') + year + (dispmonth < 10 ? '0' : '') + dispmonth + (i < 10 ? '0' : '') + i; diff --git a/tbl_change.php b/tbl_change.php index 09e85d06c..674a58830 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -770,7 +770,7 @@ foreach($loop_array AS $vrowcount => $vrow) { ?> ="return unNullify('', '')" tabindex="" id="field__3" />