calendar update function