finished calendar basic logic