Added leave calendar function.