Fix functions of calendar