mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
View
- Implemented 'description.default', 'description.count', and 'description.oneline'. - New 'indent.annotation' for the 'description.default' field format.
This commit is contained in:
parent
f37a250894
commit
28b0960015
8 changed files with 145 additions and 33 deletions
32
src/Date.cpp
32
src/Date.cpp
|
@ -694,6 +694,38 @@ int Date::monthOfYear (const std::string& input)
|
|||
return -1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Date::length (const std::string& format)
|
||||
{
|
||||
int total = 0;
|
||||
|
||||
std::string::const_iterator i;
|
||||
for (i = format.begin (); i != format.end (); ++i)
|
||||
{
|
||||
switch (*i)
|
||||
{
|
||||
case 'm':
|
||||
case 'M':
|
||||
case 'd':
|
||||
case 'D':
|
||||
case 'y':
|
||||
case 'A':
|
||||
case 'b':
|
||||
case 'B':
|
||||
case 'V':
|
||||
case 'h':
|
||||
case 'H':
|
||||
case 'N':
|
||||
case 'S': total += 2; break;
|
||||
case 'a': total += 3; break;
|
||||
case 'Y': total += 4; break;
|
||||
default: total += 1; break;
|
||||
}
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
time_t Date::easter (int year)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue