backport calendar bug fixes