{"action":"created","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/723","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/723/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/723/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/723/events","html_url":"https://github.com/IMA-WorldHealth/bhima/issues/723","id":105844436,"number":723,"title":"Standardised period selection directive","user":{"login":"sfount","id":2844572,"avatar_url":"https://avatars.githubusercontent.com/u/2844572?v=3","gravatar_id":"","url":"https://api.github.com/users/sfount","html_url":"https://github.com/sfount","followers_url":"https://api.github.com/users/sfount/followers","following_url":"https://api.github.com/users/sfount/following{/other_user}","gists_url":"https://api.github.com/users/sfount/gists{/gist_id}","starred_url":"https://api.github.com/users/sfount/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfount/subscriptions","organizations_url":"https://api.github.com/users/sfount/orgs","repos_url":"https://api.github.com/users/sfount/repos","events_url":"https://api.github.com/users/sfount/events{/privacy}","received_events_url":"https://api.github.com/users/sfount/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/labels/discussion","name":"discussion","color":"d4c5f9"},{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/labels/feature","name":"feature","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-10T16:16:07Z","updated_at":"2015-09-11T07:45:13Z","closed_at":null,"body":"There are many places in our application that require the user to choose a starting date and an end date. Currently every single module does this in a different way. This is bad for three reasons: \r\n* Confusing for the end user who has to learn many different ways to do the same thing\r\n* Rewriting the same component many times is a waste of developer time \r\n* Some of the modules use selections that do not do validity checks and break if the screen is small, it is hard to test every single version of this component. \r\n\r\nThis is an example of the sales records page - because the window is small the date selection is completely broken. \r\n\r\n![Example of date selection](http://i.imgur.com/gjjmMh7.png)\r\n\r\nAnother example of this type of selection in the application is in many of the reports - whilst this works very well it is implemented differently in different reports. \r\n\r\n![Example of additional date selections](http://i.imgur.com/ol0xvcx.png)\r\n\r\nI propose that we create a directive that allows a simple way of choosing two dates for reporting/ viewing records/ dashboard etc. The directive could show the dates currently selected very clearly and then allow the user to configure the dates using a modal **(This would allow the component to work on any sized screen)**. \r\n\r\nThis is a (very simple) mockup of how the directive could show the user the currently selected dates\r\n![Clearly show date mockup](http://i.imgur.com/gS85iVR.png) \r\n\r\nThe user can then press settings to carefully choose dates\r\n![Allow date configuration](http://i.imgur.com/MsZ6lfS.png)\r\n\r\nI propose the directive lets the user either select their own dates, or provides common dates used throughout BHIMA \r\n* Periods for this fiscal year\r\n* Previous fiscal years\r\n* Common date selections (day, week, month, year) \r\n\r\nAll of these options will result in a **start date - end date** format, however it helps the user see what dates they might use for reports and dashboards. \r\n\r\nWhat does everyone think? @IMA-WorldHealth/local-contributors @IMA-WorldHealth/remote-contributors. If this is something you think is important we can discuss what features this should have a when we should start developing this directive. "},"comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/comments/139476007","html_url":"https://github.com/IMA-WorldHealth/bhima/issues/723#issuecomment-139476007","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/723","id":139476007,"user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T07:45:13Z","updated_at":"2015-09-11T07:45:13Z","body":"Your comments are very much appreciated :).  Yeah, whoever tackles this should definitely push a prototype that we can review together and see what cases it fits best!"}}