{"action":"created","issue":{"url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/99","repository_url":"https://api.github.com/repos/soliantconsulting/SimpleFM","labels_url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/99/comments","events_url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/99/events","html_url":"https://github.com/soliantconsulting/SimpleFM/issues/99","id":232022097,"number":99,"title":"DateTransformer date format issue","user":{"login":"montaniasystemab","id":12112548,"avatar_url":"https://avatars2.githubusercontent.com/u/12112548?v=4","gravatar_id":"","url":"https://api.github.com/users/montaniasystemab","html_url":"https://github.com/montaniasystemab","followers_url":"https://api.github.com/users/montaniasystemab/followers","following_url":"https://api.github.com/users/montaniasystemab/following{/other_user}","gists_url":"https://api.github.com/users/montaniasystemab/gists{/gist_id}","starred_url":"https://api.github.com/users/montaniasystemab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montaniasystemab/subscriptions","organizations_url":"https://api.github.com/users/montaniasystemab/orgs","repos_url":"https://api.github.com/users/montaniasystemab/repos","events_url":"https://api.github.com/users/montaniasystemab/events{/privacy}","received_events_url":"https://api.github.com/users/montaniasystemab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"DASPRiD","id":233300,"avatar_url":"https://avatars1.githubusercontent.com/u/233300?v=4","gravatar_id":"","url":"https://api.github.com/users/DASPRiD","html_url":"https://github.com/DASPRiD","followers_url":"https://api.github.com/users/DASPRiD/followers","following_url":"https://api.github.com/users/DASPRiD/following{/other_user}","gists_url":"https://api.github.com/users/DASPRiD/gists{/gist_id}","starred_url":"https://api.github.com/users/DASPRiD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DASPRiD/subscriptions","organizations_url":"https://api.github.com/users/DASPRiD/orgs","repos_url":"https://api.github.com/users/DASPRiD/repos","events_url":"https://api.github.com/users/DASPRiD/events{/privacy}","received_events_url":"https://api.github.com/users/DASPRiD/received_events","type":"User","site_admin":false},"assignees":[{"login":"DASPRiD","id":233300,"avatar_url":"https://avatars1.githubusercontent.com/u/233300?v=4","gravatar_id":"","url":"https://api.github.com/users/DASPRiD","html_url":"https://github.com/DASPRiD","followers_url":"https://api.github.com/users/DASPRiD/followers","following_url":"https://api.github.com/users/DASPRiD/following{/other_user}","gists_url":"https://api.github.com/users/DASPRiD/gists{/gist_id}","starred_url":"https://api.github.com/users/DASPRiD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DASPRiD/subscriptions","organizations_url":"https://api.github.com/users/DASPRiD/orgs","repos_url":"https://api.github.com/users/DASPRiD/repos","events_url":"https://api.github.com/users/DASPRiD/events{/privacy}","received_events_url":"https://api.github.com/users/DASPRiD/received_events","type":"User","site_admin":false}],"milestone":null,"comments":12,"created_at":"2017-05-29T13:22:53Z","updated_at":"2017-07-31T14:00:20Z","closed_at":null,"body":"I'm using a repository created from XML metadata and when trying to fetch a record from FileMaker I'm getting this error from `DateTransformer`: \r\n\r\n```\r\n  Notice: Undefined offset: 0                           \r\n```\r\n\r\nTrace looks like this (testing with a Symfony console command): \r\nhttps://gist.github.com/montaniasystemab/3808750fc6cbe04e88832cb25bcafbc9\r\n\r\nDumping the value reveals another date format than what `DateTransformer` is expecting: `08-23-2010`\r\n\r\nAdding another block in `DateTransformer` with this date format seems to work, but I'm not sure if this is the best solution: \r\n\r\n```\r\nif (false === $dateTime) {\r\n    $dateTime = DateTimeImmutable::createFromFormat(\r\n        '!d-m-Y',\r\n        $value,\r\n        self::$utcTimeZone ?: (self::$utcTimeZone = new DateTimeZone('UTC'))\r\n    );\r\n}\r\n```\r\n\r\nI would like to discuss approaches to solving this issue before submitting a PR.\r\n\r\nMaybe the date format should be configurable some way? \r\n\r\nAlso, this field is actually not required by the web application, so some way to exclude it from hydration would also effectively resolve the issue for us. I've not added this field to the XML metadata file."},"comment":{"url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/comments/319075462","html_url":"https://github.com/soliantconsulting/SimpleFM/issues/99#issuecomment-319075462","issue_url":"https://api.github.com/repos/soliantconsulting/SimpleFM/issues/99","id":319075462,"user":{"login":"montaniasystemab","id":12112548,"avatar_url":"https://avatars2.githubusercontent.com/u/12112548?v=4","gravatar_id":"","url":"https://api.github.com/users/montaniasystemab","html_url":"https://github.com/montaniasystemab","followers_url":"https://api.github.com/users/montaniasystemab/followers","following_url":"https://api.github.com/users/montaniasystemab/following{/other_user}","gists_url":"https://api.github.com/users/montaniasystemab/gists{/gist_id}","starred_url":"https://api.github.com/users/montaniasystemab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montaniasystemab/subscriptions","organizations_url":"https://api.github.com/users/montaniasystemab/orgs","repos_url":"https://api.github.com/users/montaniasystemab/repos","events_url":"https://api.github.com/users/montaniasystemab/events{/privacy}","received_events_url":"https://api.github.com/users/montaniasystemab/received_events","type":"User","site_admin":false},"created_at":"2017-07-31T14:00:20Z","updated_at":"2017-07-31T14:00:20Z","body":"Sorry for the late reply, it's been holiday season here in Sweden =)\r\n\r\n@jeremiahsmall I decided to add the format used by our FileMaker Server in `DateTransformer` because the project was about to go live. \r\n\r\nI've not been able to figure out a solution which does not require changes in `DateTransformer`\r\n\r\nUnfortunately changing the types in FileMaker is not an alternative since there's other integrations in place as well that we're reluctant to break/change. "}}
{"actor":{"display_login":"montaniasystemab"}}