From 6f4add6f715cfefa283f0087c98ccc8ae9edc62f Mon Sep 17 00:00:00 2001
From: wyrie <wyrie@ispconfig3>
Date: Thu, 08 Apr 2010 13:59:59 -0400
Subject: [PATCH] Added support for datetime form encoding

---
 interface/lib/classes/remoting_lib.inc.php |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 26153c4..df13dff 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -325,6 +325,18 @@
                                 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

--
Gitblit v1.9.1