From 6f4add6f715cfefa283f0087c98ccc8ae9edc62f Mon Sep 17 00:00:00 2001 From: wyrie Date: Thu, 8 Apr 2010 17:59:59 +0000 Subject: [PATCH] Added support for datetime form encoding --- interface/lib/classes/remoting_lib.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php index 26153c4aa3..df13dffa9a 100644 --- a/interface/lib/classes/remoting_lib.inc.php +++ b/interface/lib/classes/remoting_lib.inc.php @@ -325,6 +325,18 @@ class remoting_lib { case 'CURRENCY': $new_record[$key] = str_replace(",",".",$record[$key]); break; + + case 'DATETIME': + if (is_array($record[$key])) + { + $filtered_values = array_map(create_function('$item','return (int)$item;'), $record[$key]); + extract($filtered_values, EXTR_PREFIX_ALL, '_dt'); + + if ($_dt_day != 0 && $_dt_month != 0 && $_dt_year != 0) { + $new_record[$key] = date( 'Y-m-d H:i:s', mktime($_dt_hour, $_dt_minute, $_dt_second, $_dt_month, $_dt_day, $_dt_year) ); + } + } + break; } // The use of the field value is deprecated, use validators instead -- GitLab