update calendar logic