Move calendar function into command