- The duration 'm' is now interpreted as 'months', not 'minutes'.
This commit is contained in:
Paul Beckingham 2011-06-30 18:35:54 -04:00
parent 829a26d70b
commit fd484ee264
3 changed files with 11 additions and 6 deletions

View file

@ -56,7 +56,6 @@ static const char* durations[] =
"minutes",
"mins",
"min",
"m",
"mnths",
"monthly",
@ -65,6 +64,7 @@ static const char* durations[] =
"mos",
"mo",
"mths",
"m",
"quarterly",
"quarters",
@ -338,6 +338,7 @@ void Duration::parse (const std::string& input)
else if (match == "mos") mSecs = (int) (value * 86400 * 30);
else if (match == "mo") mSecs = (int) (value * 86400 * 30);
else if (match == "mths") mSecs = (int) (value * 86400 * 30);
else if (match == "m") mSecs = (int) (value * 86400 * 30);
else if (match == "biweekly") mSecs = (int) (value * 86400 * 14);
else if (match == "fortnight") mSecs = (int) (value * 86400 * 14);
@ -361,7 +362,6 @@ void Duration::parse (const std::string& input)
else if (match == "minutes") mSecs = (int) (value * 60);
else if (match == "mins") mSecs = (int) (value * 60);
else if (match == "min") mSecs = (int) (value * 60);
else if (match == "m") mSecs = (int) (value * 60);
else if (match == "seconds") mSecs = (int) value;
else if (match == "secs") mSecs = (int) value;