mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug #919
- Applied patch for bug #919, so the holidays listed on the 'calendar' report are sorted (thanks to Jörg Plate). Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
parent
003f092bf4
commit
43076a6cd7
2 changed files with 21 additions and 11 deletions
|
@ -29,6 +29,8 @@ Features
|
|||
with 'dateformat.info'.
|
||||
|
||||
Bugs
|
||||
+ Applied patch for bug #919, so the holidays listed on the 'calendar' report
|
||||
are sorted (thanks to Jörg Plate).
|
||||
+ Fixed bug #954, which caused bulk deletions when using a UUID filter term and
|
||||
the delete command (thanks to Bryce Harrington).
|
||||
+ Fixed bug #959, which forces use of dateformat for annotations when using the
|
||||
|
|
|
@ -361,6 +361,7 @@ int CmdCalendar::execute (std::string& output)
|
|||
holTable.add (Column::factory ("string", STRING_CMD_CAL_LABEL_HOL));
|
||||
|
||||
std::vector <std::string>::iterator it;
|
||||
std::map <time_t, std::string> hm;
|
||||
for (it = holidays.begin (); it != holidays.end (); ++it)
|
||||
if (it->substr (0, 8) == "holiday.")
|
||||
if (it->substr (it->size () - 4) == "name")
|
||||
|
@ -371,20 +372,27 @@ int CmdCalendar::execute (std::string& output)
|
|||
|
||||
if (date_after < hDate && hDate < date_before)
|
||||
{
|
||||
std::string format = context.config.get ("report." +
|
||||
context.config.get ("calendar.details.report") +
|
||||
".dateformat");
|
||||
if (format == "")
|
||||
format = context.config.get ("dateformat.report");
|
||||
if (format == "")
|
||||
format = context.config.get ("dateformat");
|
||||
|
||||
int row = holTable.addRow ();
|
||||
holTable.set (row, 0, hDate.toString (format));
|
||||
holTable.set (row, 1, holName);
|
||||
hm[hDate.toEpoch()] = holName;
|
||||
}
|
||||
}
|
||||
|
||||
std::string format = context.config.get ("report." +
|
||||
context.config.get ("calendar.details.report") +
|
||||
".dateformat");
|
||||
if (format == "")
|
||||
format = context.config.get ("dateformat.report");
|
||||
if (format == "")
|
||||
format = context.config.get ("dateformat");
|
||||
|
||||
std::map <time_t, std::string>::iterator hm_it;
|
||||
for (hm_it = hm.begin(); hm_it != hm.end(); ++hm_it)
|
||||
{
|
||||
int row = holTable.addRow ();
|
||||
Date hDate (hm_it->first);
|
||||
holTable.set (row, 0, hDate.toString (format));
|
||||
holTable.set (row, 1, hm_it->second);
|
||||
}
|
||||
|
||||
out << optionalBlankLine ()
|
||||
<< holTable.render ()
|
||||
<< "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue