Commit edb827d6 authored by tbrehm's avatar tbrehm
Browse files

Added new DATE and DATETSTAMP datatypes to remoting lib.

parent 57540eeb
......@@ -192,11 +192,18 @@ class remoting_lib {
$new_record[$key] = stripslashes($record[$key]);
break;
case 'DATE':
case 'DATETSTAMP':
if($record[$key] > 0) {
$new_record[$key] = date($this->dateformat,$record[$key]);
}
break;
case 'DATE':
if($record[$key] != '' && $record[$key] != '0000-00-00') {
$tmp = explode('-',$record[$key]);
$new_record[$key] = date($this->dateformat,mktime(0, 0, 0, $tmp[1] , $tmp[2], $tmp[0]));
}
break;
case 'INTEGER':
$new_record[$key] = intval($record[$key]);
......@@ -306,13 +313,23 @@ class remoting_lib {
$new_record[$key] = implode($field['separator'],$record[$key]);
}
break;
case 'DATE':
case 'DATETSTAMP':
if($record[$key] > 0) {
list($tag,$monat,$jahr) = explode('.',$record[$key]);
$new_record[$key] = mktime(0,0,0,$monat,$tag,$jahr);
} else {
$new_record[$key] = 0;
}
break;
case 'DATE':
if($record[$key] != '' && $record[$key] != '0000-00-00') {
list($tag,$monat,$jahr) = explode('.',$record[$key]);
$new_record[$key] = $jahr.'-'.$monat.'-'.$tag;
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
} else {
$new_record[$key] = '0000-00-00';
}
break;
case 'INTEGER':
$new_record[$key] = (isset($record[$key]))?intval($record[$key]):0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment