{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/504","labels_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/504/labels{/name}","comments_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/504/comments","events_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/504/events","html_url":"https://github.com/angular-gantt/angular-gantt/issues/504","id":108186346,"number":504,"title":"Current date indicator sometimes disappears when set to 'column'","user":{"login":"DanTalash","id":3004715,"avatar_url":"https://avatars.githubusercontent.com/u/3004715?v=3","gravatar_id":"","url":"https://api.github.com/users/DanTalash","html_url":"https://github.com/DanTalash","followers_url":"https://api.github.com/users/DanTalash/followers","following_url":"https://api.github.com/users/DanTalash/following{/other_user}","gists_url":"https://api.github.com/users/DanTalash/gists{/gist_id}","starred_url":"https://api.github.com/users/DanTalash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanTalash/subscriptions","organizations_url":"https://api.github.com/users/DanTalash/orgs","repos_url":"https://api.github.com/users/DanTalash/repos","events_url":"https://api.github.com/users/DanTalash/events{/privacy}","received_events_url":"https://api.github.com/users/DanTalash/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-gantt/angular-gantt/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-24T18:23:00Z","updated_at":"2015-10-04T11:59:14Z","closed_at":"2015-10-04T11:59:14Z","body":"There is an issue with the library where the current day column loses the current day class.\r\n\r\nHere is a plunkr [which exhibits the problem](http://embed.plnkr.co/vunmtMEEWxXQ0hhasBkh/preview). Instructions for reproducing the problem are given below:\r\n\r\n1. When the page loads it should highlight today's date as the current date.\r\n2. Most data changes will cause the current date column to lose the current date class.\r\n3. Try one of the following methods to cause the current date to be lost:\r\n  * Add, then subtract a week from the task dates.\r\n  * Change task dates by incrementing the 'Duration of rows' input.\r\n  * Add a new row by incrementing the 'Rows' quantity. The first row addition will not trigger the bug, but the second will. From here, decrementing the number of rows will again cause the day class to be re-added, but only for a row quantity that has been rendered before.\r\n4. Oddly, toggling time rounding (daily option) state will cause the current date indicator to re-appear.\r\n\r\n---\r\n\r\nHere is a gif showing the problem. In each case the current day indicator is forced to reappear by toggling time rounding.\r\n\r\n![angular-gantt-issue-504](https://cloud.githubusercontent.com/assets/3004715/10081609/97094774-62aa-11e5-813b-02d58c79226a.gif)\r\n\r\n---\r\n\r\nAfter some digging into the cause of this, it appears that the problem is caused because the [`GanttCurrentDateManager.setCurrentDate`](https://github.com/angular-gantt/angular-gantt/blob/master/src/core/logic/calendar/currentDateManager.factory.js#L24-L47) function is fired before the columns are [populated with their `$element` properties](https://github.com/angular-gantt/angular-gantt/blob/master/src/core/ui/template/column.directive.js#L6). So, while the function does find the correct columns, the column returned does not contain an `$element` that can have the class attached.\r\n\r\nThe only current workarounds for this are:\r\n* Use the `'line'` option instead of `'column'`.\r\n* Toggle time rounding twice whenever the data changes.\r\n\r\nNeither of the two above workarounds are desirable."}}