complete function of calendar