Add support for DATETIME.
This commit is contained in:
@@ -7,6 +7,8 @@ $Source$
|
||||
|
||||
2004-04-18 Michal Cihar <michal@cihar.com>
|
||||
* 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 <me@derrabus.de>
|
||||
* lang/german-*.inc.php: Updates.
|
||||
|
@@ -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 += '<table class="calendar"><tr><th><a href="#" onclick="month--; initCalendar();">«</a> ' + month_names[month] + ' <a href="#" onclick="month++; initCalendar();">»</a></th><th><a href="#" onclick="year--; initCalendar();">«</a> ' + year + ' <a href="#" onclick="year++; initCalendar();">»</a></th></tr></table>';
|
||||
|
||||
//heading table
|
||||
str += '<table class="calendar"><tr><th width="50%">';
|
||||
str += '<a href="#" onclick="month--; initCalendar();">«</a> ';
|
||||
str += month_names[month];
|
||||
str += ' <a href="#" onclick="month++; initCalendar();">»</a>';
|
||||
str += '</th><th width="50%">';
|
||||
str += '<a href="#" onclick="year--; initCalendar();">«</a> ';
|
||||
str += year;
|
||||
str += ' <a href="#" onclick="year++; initCalendar();">»</a>';
|
||||
str += '</th></tr></table>';
|
||||
|
||||
str += '<table class="calendar"><tr>';
|
||||
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;
|
||||
|
@@ -770,7 +770,7 @@ foreach($loop_array AS $vrowcount => $vrow) {
|
||||
?>
|
||||
<input type="text" name="fields<?php echo $vkey; ?>[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $maxlength; ?>" class="textfield" <?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $vkey; ?>')" tabindex="<?php echo (($i * $m_rows) + 1); ?>" id="field_<?php echo ($i * $m_rows); ?>_3" />
|
||||
<?php
|
||||
if ($type == 'date' || substr($type, 0, 9) == 'timestamp') {
|
||||
if ($type == 'date' || $type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
Reference in New Issue
Block a user