fixed bad date calculations

--HG--
branch : beta