0012228: employee bday should be saved as datetime
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 26 Sep 2016 14:36:23 +0000 (16:36 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 27 Sep 2016 12:47:36 +0000 (14:47 +0200)
https://forge.tine20.org/view.php?id=12228

Change-Id: Icd6ccf65c68def112fee01bde1e73508e91c02cc
Reviewed-on: http://gerrit.tine20.com/customers/3618
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/HumanResources/JsonTests.php
tine20/HumanResources/Model/Employee.php

index 12136d4..8aad76e 100644 (file)
@@ -181,6 +181,18 @@ class HumanResources_JsonTests extends HumanResources_TestCase
     }
 
     /**
+     * @see 0012228: employee bday should be saved as datetime
+     */
+    public function testBirthday()
+    {
+        $e = $this->_getEmployee();
+        $datetime = new Tinebase_DateTime('2009-03-02 00:00:00');
+        $e->bday = $datetime;
+        $savedEmployee = $this->_json->saveEmployee($e->toArray());
+        $this->assertEquals($datetime->toString(), $savedEmployee['bday']);
+    }
+
+    /**
      * Tests the duplicate check
      */
     public function testDuplicateException()
index 7be2096..d271435 100644 (file)
@@ -148,7 +148,7 @@ class HumanResources_Model_Employee extends Tinebase_Record_Abstract
             ),
             'bday' => array(
                 'label' => 'Birthday', //_('Birthday')
-                'type'  => 'date',
+                'type'  => 'datetime',
                 'group' => 'private',
             ),
             'bank_account_holder' => array(