refactoring dayview to directive