calendar edit function