backport fix from calendar repo