{"action":"created","issue":{"url":"https://api.github.com/repos/bolt/bolt/issues/3459","labels_url":"https://api.github.com/repos/bolt/bolt/issues/3459/labels{/name}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/3459/comments","events_url":"https://api.github.com/repos/bolt/bolt/issues/3459/events","html_url":"https://github.com/bolt/bolt/issues/3459","id":71684924,"number":3459,"title":"Boltforms/ContentType and Date field type","user":{"login":"leocavalcante","id":183722,"avatar_url":"https://avatars.githubusercontent.com/u/183722?v=3","gravatar_id":"","url":"https://api.github.com/users/leocavalcante","html_url":"https://github.com/leocavalcante","followers_url":"https://api.github.com/users/leocavalcante/followers","following_url":"https://api.github.com/users/leocavalcante/following{/other_user}","gists_url":"https://api.github.com/users/leocavalcante/gists{/gist_id}","starred_url":"https://api.github.com/users/leocavalcante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leocavalcante/subscriptions","organizations_url":"https://api.github.com/users/leocavalcante/orgs","repos_url":"https://api.github.com/users/leocavalcante/repos","events_url":"https://api.github.com/users/leocavalcante/events{/privacy}","received_events_url":"https://api.github.com/users/leocavalcante/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-28T19:50:10Z","updated_at":"2015-05-05T12:14:07Z","closed_at":null,"body":"I was getting `Catchable fatal error: Object of class DateTime could not be converted to string` if a form field of type birthday linked to an ContentType field of type date.\r\n\r\nThe solution was:\r\n\r\n**Bolt\\Content.php below line 287**\r\n```php\r\nif ($this->values[$key] instanceof \\DateTime) {\r\n    $this->values[$key] = $this->values[$key]->format('c');\r\n}\r\n```\r\n\r\n**Bolt\\Extension\\Bolt\\BoltForms\\Database.php below line 81**\r\n```php\r\nif ($value instanceof \\DateTime) {\r\n    $savedata[$key] = $value->format('c');\r\n}\r\n```\r\nNot sure if is the best solution, but solved to me.\r\n"},"comment":{"url":"https://api.github.com/repos/bolt/bolt/issues/comments/99063471","html_url":"https://github.com/bolt/bolt/issues/3459#issuecomment-99063471","issue_url":"https://api.github.com/repos/bolt/bolt/issues/3459","id":99063471,"user":{"login":"bobdenotter","id":1833361,"avatar_url":"https://avatars.githubusercontent.com/u/1833361?v=3","gravatar_id":"","url":"https://api.github.com/users/bobdenotter","html_url":"https://github.com/bobdenotter","followers_url":"https://api.github.com/users/bobdenotter/followers","following_url":"https://api.github.com/users/bobdenotter/following{/other_user}","gists_url":"https://api.github.com/users/bobdenotter/gists{/gist_id}","starred_url":"https://api.github.com/users/bobdenotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobdenotter/subscriptions","organizations_url":"https://api.github.com/users/bobdenotter/orgs","repos_url":"https://api.github.com/users/bobdenotter/repos","events_url":"https://api.github.com/users/bobdenotter/events{/privacy}","received_events_url":"https://api.github.com/users/bobdenotter/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T12:14:07Z","updated_at":"2015-05-05T12:14:07Z","body":"Hi @leocavalcante,\r\n\r\nCould you give a bit more information about what you were doing, that caused these errors? I _think_ your solution won't cause any side-effects, but we'd need to test those out. \r\n"}}