Transform add-to-calendar into a closure