Factored out calendar IO