Optimize Date::modify method.