- added a calendar offset that effectively changes the first
  month to be displayed in the calendar report (thanks to
  Michelle Crane)
- calendar.offset turns the featue off or on
- calendar.offset.value controls the number of month to be
  applied for the offset
This commit is contained in:
Federico Hernandez
2010-12-01 23:25:13 +01:00
parent 14ab7ba7bd
commit 4ca35fb956
7 changed files with 61 additions and 6 deletions

View File

@@ -1477,10 +1477,29 @@ int handleReportCalendar (std::string& outs)
yFrom = oldest.year();
}
if (context.config.getBoolean ("calendar.offset"))
{
int moffset = context.config.getInteger ("calendar.offset.value") % 12;
int yoffset = context.config.getInteger ("calendar.offset.value") / 12;
mFrom += moffset;
yFrom += yoffset;
if (mFrom < 1)
{
mFrom += 12;
yFrom--;
}
else if (mFrom > 12)
{
mFrom -= 12;
yFrom++;
}
}
mTo = mFrom + monthsToDisplay - 1;
yTo = yFrom;
if (mTo > 12) {
mTo -=12;
if (mTo > 12)
{
mTo -= 12;
yTo++;
}