{"action":"created","issue":{"url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/17","labels_url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/17/comments","events_url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/17/events","html_url":"https://github.com/Sammaye/yii2-audittrail/issues/17","id":113041670,"number":17,"title":"How can we fetch value of a audit trailed attribute on a given date","user":{"login":"jacksumit","id":13305490,"avatar_url":"https://avatars.githubusercontent.com/u/13305490?v=3","gravatar_id":"","url":"https://api.github.com/users/jacksumit","html_url":"https://github.com/jacksumit","followers_url":"https://api.github.com/users/jacksumit/followers","following_url":"https://api.github.com/users/jacksumit/following{/other_user}","gists_url":"https://api.github.com/users/jacksumit/gists{/gist_id}","starred_url":"https://api.github.com/users/jacksumit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacksumit/subscriptions","organizations_url":"https://api.github.com/users/jacksumit/orgs","repos_url":"https://api.github.com/users/jacksumit/repos","events_url":"https://api.github.com/users/jacksumit/events{/privacy}","received_events_url":"https://api.github.com/users/jacksumit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-23T15:21:39Z","updated_at":"2015-10-27T14:57:26Z","closed_at":"2015-10-27T13:48:29Z","body":"How can we get the value of an audit trailed attribute on particular date? For example say there is a attribute Status in a model which undergone below changes\r\n\r\n01/01/2015 - Open\r\n05/02/2015 - In Progress\r\n07/04/2015 - Waiting\r\n04/07/2015 - Closed\r\n\r\nSimilary status on other records also got changed on different dates.\r\n\r\nNow say I want to generate a report of all the records of this model with status as on 01/04/2015. How can I achieve that? \r\n\r\nI propose to add another column in audit trail which stores the end time stamp of that audit trail record (say endTimeStamp). So on any update we have to first search if any previous audit trail record exists for same attribute and same model and model id. If yes we have to stamp the endTimeStamp with the time stamp of new audit trail record. Now we can identify the value of status attribute of model on any date by checking timestamp <= '01/04/2015' and (endTimeStamp > '01/04/2015' or endTimeStamp is null)."},"comment":{"url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/comments/151529935","html_url":"https://github.com/Sammaye/yii2-audittrail/issues/17#issuecomment-151529935","issue_url":"https://api.github.com/repos/Sammaye/yii2-audittrail/issues/17","id":151529935,"user":{"login":"Sammaye","id":323996,"avatar_url":"https://avatars.githubusercontent.com/u/323996?v=3","gravatar_id":"","url":"https://api.github.com/users/Sammaye","html_url":"https://github.com/Sammaye","followers_url":"https://api.github.com/users/Sammaye/followers","following_url":"https://api.github.com/users/Sammaye/following{/other_user}","gists_url":"https://api.github.com/users/Sammaye/gists{/gist_id}","starred_url":"https://api.github.com/users/Sammaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sammaye/subscriptions","organizations_url":"https://api.github.com/users/Sammaye/orgs","repos_url":"https://api.github.com/users/Sammaye/repos","events_url":"https://api.github.com/users/Sammaye/events{/privacy}","received_events_url":"https://api.github.com/users/Sammaye/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T14:57:26Z","updated_at":"2015-10-27T14:57:26Z","body":"Let me think about this some more, maybe you can add more of the scenario, like what you intend to achieve in terms of (I assume) displaying this, or what the data is for? Atm I have seen the intended implementation but it that only shows a small fraction, I am probably missing something and I am sure it is crucial to understanding your reasoning for this."}}