- Fixed bug where dateformat=m/d/Y was not parsing "07/08/2008", which is technically "M/D/Y", but, come on, let's be nice.

- Altered (deprecated) TUTORIAL introductory disclaimer.
This commit is contained in:
Paul Beckingham 2008-07-10 01:46:08 -04:00
parent fe03f91744
commit 86f5294436
6 changed files with 38 additions and 34 deletions

View file

@ -82,8 +82,8 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
}
if (i + 1 < mdy.length () &&
mdy[i + 0] == '1' &&
(mdy[i + 1] == '0' || mdy[i + 1] == '1' || mdy[i + 1] == '2'))
(mdy[i + 0] == '0' || mdy[i + 0] == '1') &&
::isdigit (mdy[i + 1]))
{
month = ::atoi (mdy.substr (i, 2).c_str ());
i += 2;
@ -102,8 +102,8 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
if (i + 1 < mdy.length () &&
(mdy[i + 0] == '1' || mdy[i + 0] == '2' || mdy[i + 0] == '3') &&
if (i + 1 < mdy.length () &&
(mdy[i + 0] == '0' || mdy[i + 0] == '1' || mdy[i + 0] == '2' || mdy[i + 0] == '3') &&
::isdigit (mdy[i + 1]))
{
day = ::atoi (mdy.substr (i, 2).c_str ());