Fixed bugs in calendar view and time view