mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhancement
- Allows relative dates such as "1st" to be entered with capital ("1ST").
This commit is contained in:
parent
ee0a16f663
commit
b5cd5ea188
2 changed files with 15 additions and 8 deletions
14
src/Date.cpp
14
src/Date.cpp
|
@ -992,21 +992,21 @@ bool Date::isRelativeDate (const std::string& input)
|
|||
}
|
||||
|
||||
// Support "21st" to indicate the next date that is the 21st day.
|
||||
else if (input.length () <= 4 &&
|
||||
isdigit (input[0]))
|
||||
else if (in.length () <= 4 &&
|
||||
isdigit (in[0]))
|
||||
{
|
||||
int number;
|
||||
std::string ordinal;
|
||||
|
||||
if (isdigit (input[1]))
|
||||
if (isdigit (in[1]))
|
||||
{
|
||||
number = atoi (input.substr (0, 2).c_str ());
|
||||
ordinal = lowerCase (input.substr (2));
|
||||
number = atoi (in.substr (0, 2).c_str ());
|
||||
ordinal = lowerCase (in.substr (2));
|
||||
}
|
||||
else
|
||||
{
|
||||
number = atoi (input.substr (0, 2).c_str ());
|
||||
ordinal = lowerCase (input.substr (1));
|
||||
number = atoi (in.substr (0, 2).c_str ());
|
||||
ordinal = lowerCase (in.substr (1));
|
||||
}
|
||||
|
||||
// Sanity check.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue