fixing calendar() so that it works across DSTs