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:
committed by
Paul Beckingham
parent
003f092bf4
commit
43076a6cd7
@@ -29,6 +29,8 @@ Features
|
|||||||
with 'dateformat.info'.
|
with 'dateformat.info'.
|
||||||
|
|
||||||
Bugs
|
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
|
+ Fixed bug #954, which caused bulk deletions when using a UUID filter term and
|
||||||
the delete command (thanks to Bryce Harrington).
|
the delete command (thanks to Bryce Harrington).
|
||||||
+ Fixed bug #959, which forces use of dateformat for annotations when using the
|
+ 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));
|
holTable.add (Column::factory ("string", STRING_CMD_CAL_LABEL_HOL));
|
||||||
|
|
||||||
std::vector <std::string>::iterator it;
|
std::vector <std::string>::iterator it;
|
||||||
|
std::map <time_t, std::string> hm;
|
||||||
for (it = holidays.begin (); it != holidays.end (); ++it)
|
for (it = holidays.begin (); it != holidays.end (); ++it)
|
||||||
if (it->substr (0, 8) == "holiday.")
|
if (it->substr (0, 8) == "holiday.")
|
||||||
if (it->substr (it->size () - 4) == "name")
|
if (it->substr (it->size () - 4) == "name")
|
||||||
@@ -371,20 +372,27 @@ int CmdCalendar::execute (std::string& output)
|
|||||||
|
|
||||||
if (date_after < hDate && hDate < date_before)
|
if (date_after < hDate && hDate < date_before)
|
||||||
{
|
{
|
||||||
std::string format = context.config.get ("report." +
|
hm[hDate.toEpoch()] = holName;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 ()
|
out << optionalBlankLine ()
|
||||||
<< holTable.render ()
|
<< holTable.render ()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user