mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Dates
- Fixed a loose, ill-defined, poorly constructed excuse for a detector of date ordinals ("1st, "22nd", "3rd" and "6th").
This commit is contained in:
parent
43d953094b
commit
0a67913b48
1 changed files with 20 additions and 3 deletions
|
@ -353,9 +353,26 @@ bool namedDates (const std::string& name, Variant& value)
|
||||||
// 1st
|
// 1st
|
||||||
// 2nd
|
// 2nd
|
||||||
// 3rd
|
// 3rd
|
||||||
else if (name.length () >= 3 &&
|
// 4th
|
||||||
name.length () <= 4 &&
|
else if ((
|
||||||
isdigit (name[0]))
|
name.length () == 3 &&
|
||||||
|
isdigit (name[0]) &&
|
||||||
|
((name[1] == 's' && name[2] == 't') ||
|
||||||
|
(name[1] == 'n' && name[2] == 'd') ||
|
||||||
|
(name[1] == 'r' && name[2] == 'd') ||
|
||||||
|
(name[1] == 't' && name[2] == 'h'))
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
name.length () == 4 &&
|
||||||
|
isdigit (name[0]) &&
|
||||||
|
isdigit (name[1]) &&
|
||||||
|
((name[2] == 's' && name[3] == 't') ||
|
||||||
|
(name[2] == 'n' && name[3] == 'd') ||
|
||||||
|
(name[2] == 'r' && name[3] == 'd') ||
|
||||||
|
(name[2] == 't' && name[3] == 'h'))
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
int number;
|
int number;
|
||||||
std::string ordinal;
|
std::string ordinal;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue