Finish write common functions of calendar