Calendar rebase (2)

This replaces #1316.