tidy calendar code