{"action":"created","issue":{"url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/181","labels_url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/181/comments","events_url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/181/events","html_url":"https://github.com/lexik/LexikFormFilterBundle/pull/181","id":110916286,"number":181,"title":"Handle timezones in a correct way.","user":{"login":"phjedi","id":14072809,"avatar_url":"https://avatars.githubusercontent.com/u/14072809?v=3","gravatar_id":"","url":"https://api.github.com/users/phjedi","html_url":"https://github.com/phjedi","followers_url":"https://api.github.com/users/phjedi/followers","following_url":"https://api.github.com/users/phjedi/following{/other_user}","gists_url":"https://api.github.com/users/phjedi/gists{/gist_id}","starred_url":"https://api.github.com/users/phjedi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phjedi/subscriptions","organizations_url":"https://api.github.com/users/phjedi/orgs","repos_url":"https://api.github.com/users/phjedi/repos","events_url":"https://api.github.com/users/phjedi/events{/privacy}","received_events_url":"https://api.github.com/users/phjedi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-12T06:47:23Z","updated_at":"2015-10-20T12:46:23Z","closed_at":"2015-10-20T12:46:11Z","pull_request":{"url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/pulls/181","html_url":"https://github.com/lexik/LexikFormFilterBundle/pull/181","diff_url":"https://github.com/lexik/LexikFormFilterBundle/pull/181.diff","patch_url":"https://github.com/lexik/LexikFormFilterBundle/pull/181.patch"},"body":"Hi guys.\r\nIt looks like you omitted Symfony2 form options like 'model_timezone' and 'view_timezone' using the next chunk of code:\r\n\r\n```php\r\n    protected function convertToSqlDate($date, $isMax = false)\r\n    {\r\n        if (! $date instanceof \\DateTime) {\r\n            return;\r\n        }\r\n\r\n        if ($isMax) {\r\n            $date->setTime(23, 59, 59);\r\n        } else {\r\n            $date->setTime(0, 0, 0);\r\n        }\r\n\r\n        return $this->expr()->literal($date->format(self::SQL_DATE_TIME));\r\n    }\r\n```\r\n\r\nWe kindly ask you to replace it with something like this one:\r\n\r\n```php\r\n    protected function convertToSqlDate($date, $isMax = false)\r\n    {\r\n        if (! $date instanceof \\DateTime) {\r\n            return;\r\n        }\r\n\r\n        if ($isMax) {\r\n            $date->modify('+1 day -1 second');\r\n        }\r\n\r\n        return $this->expr()->literal($date->format(self::SQL_DATE_TIME));\r\n    }\r\n```\r\n\r\nIt should handle timezones in a correct way.\r\n"},"comment":{"url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/comments/149554126","html_url":"https://github.com/lexik/LexikFormFilterBundle/pull/181#issuecomment-149554126","issue_url":"https://api.github.com/repos/lexik/LexikFormFilterBundle/issues/181","id":149554126,"user":{"login":"cedric-g","id":570306,"avatar_url":"https://avatars.githubusercontent.com/u/570306?v=3","gravatar_id":"","url":"https://api.github.com/users/cedric-g","html_url":"https://github.com/cedric-g","followers_url":"https://api.github.com/users/cedric-g/followers","following_url":"https://api.github.com/users/cedric-g/following{/other_user}","gists_url":"https://api.github.com/users/cedric-g/gists{/gist_id}","starred_url":"https://api.github.com/users/cedric-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedric-g/subscriptions","organizations_url":"https://api.github.com/users/cedric-g/orgs","repos_url":"https://api.github.com/users/cedric-g/repos","events_url":"https://api.github.com/users/cedric-g/events{/privacy}","received_events_url":"https://api.github.com/users/cedric-g/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T12:46:23Z","updated_at":"2015-10-20T12:46:23Z","body":"Thx :smiley: "}}