{"action":"created","issue":{"url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1707","repository_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel","labels_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1707/labels{/name}","comments_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1707/comments","events_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1707/events","html_url":"https://github.com/Maatwebsite/Laravel-Excel/issues/1707","id":336538490,"node_id":"MDU6SXNzdWUzMzY1Mzg0OTA=","number":1707,"title":"[QUESTION] Export date column does not let you to order cells in excel file","user":{"login":"GiacomoK","id":16156317,"node_id":"MDQ6VXNlcjE2MTU2MzE3","avatar_url":"https://avatars2.githubusercontent.com/u/16156317?v=4","gravatar_id":"","url":"https://api.github.com/users/GiacomoK","html_url":"https://github.com/GiacomoK","followers_url":"https://api.github.com/users/GiacomoK/followers","following_url":"https://api.github.com/users/GiacomoK/following{/other_user}","gists_url":"https://api.github.com/users/GiacomoK/gists{/gist_id}","starred_url":"https://api.github.com/users/GiacomoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GiacomoK/subscriptions","organizations_url":"https://api.github.com/users/GiacomoK/orgs","repos_url":"https://api.github.com/users/GiacomoK/repos","events_url":"https://api.github.com/users/GiacomoK/events{/privacy}","received_events_url":"https://api.github.com/users/GiacomoK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T09:14:33Z","updated_at":"2018-06-28T09:28:05Z","closed_at":null,"author_association":"NONE","body":"### Versions\r\n\r\n<!-- Please be as exact and complete as possible when proving version numbers -->\r\n\r\n* PHP version: 5.6\r\n* Laravel version: 5.2\r\n* Package version: 2.1\r\n\r\n### Description\r\n\r\nI export an excel file with \"fromArray\" function and I need a date column. I formatted the column with \"setColumnFormat\" function, but in the excel file I can not order column by date.\r\n\r\n### Steps to Reproduce\r\n\r\nThis is the starting array:\r\n\r\n    array:2 [▼  \r\n        0 => array:2 [▼\r\n            \"Checklist\" => \"First value\"\r\n            \"Data scadenza\" => \"31/05/2018\"\r\n        ]\r\n        1 => array:2 [▼\r\n            \"Checklist\" => \"Second value\"\r\n            \"Data scadenza\" => \"07/06/2018\"\r\n        ]\r\n    ]\r\n\r\nThis is the code to export:\r\n\r\n    Excel::create('Deadlines' . date('Ymd') , function($excel) use ($items_formatted) {\r\n        $excel->sheet('Excel sheet', function($sheet) use ($items_formatted) {\r\n            $sheet->setColumnFormat(array(\r\n                'B' => \\PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY\r\n            ));\r\n            $sheet->fromArray($items_formatted);\r\n        });\r\n    })->export('xls');`\r\n\r\n**Expected behavior:**\r\n\r\nThe B column of the excel is ordable and formatted as a date.\r\n\r\n**Actual behavior:** \r\n\r\nThe B column of the excel file is formatted as text (if you look the screenshot you see an apex before the date)\r\n![schermata](https://user-images.githubusercontent.com/16156317/42025252-668ba5f8-7ac4-11e8-9dc5-d0e8b9eaaab4.png)\r\n and is not ordable like date.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/comments/400972776","html_url":"https://github.com/Maatwebsite/Laravel-Excel/issues/1707#issuecomment-400972776","issue_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1707","id":400972776,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDk3Mjc3Ng==","user":{"login":"GiacomoK","id":16156317,"node_id":"MDQ6VXNlcjE2MTU2MzE3","avatar_url":"https://avatars2.githubusercontent.com/u/16156317?v=4","gravatar_id":"","url":"https://api.github.com/users/GiacomoK","html_url":"https://github.com/GiacomoK","followers_url":"https://api.github.com/users/GiacomoK/followers","following_url":"https://api.github.com/users/GiacomoK/following{/other_user}","gists_url":"https://api.github.com/users/GiacomoK/gists{/gist_id}","starred_url":"https://api.github.com/users/GiacomoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GiacomoK/subscriptions","organizations_url":"https://api.github.com/users/GiacomoK/orgs","repos_url":"https://api.github.com/users/GiacomoK/repos","events_url":"https://api.github.com/users/GiacomoK/events{/privacy}","received_events_url":"https://api.github.com/users/GiacomoK/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T09:28:05Z","updated_at":"2018-06-28T09:28:05Z","author_association":"NONE","body":"I solved useing the function `\\PHPExcel_Shared_Date::FormattedPHPToExcel` to create the starting array.\r\n\r\n"}}
{"actor":{"display_login":"GiacomoK"}}