use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyReportsTest method testGetReports.
@Test
public void testGetReports() throws Exception {
GetMonthlyReports cmd = new GetMonthlyReports(6);
cmd.setStartMonth(new Month(2009, 1));
cmd.setEndMonth(new Month(2009, 2));
MonthlyReportResult result = execute(cmd);
Assert.assertEquals(1, result.getData().size());
Assert.assertEquals(35, result.getData().get(0).getValue(2009, 1).intValue());
Assert.assertEquals(70, result.getData().get(0).getValue(2009, 2).intValue());
}
use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyGrid method updateMonthColumns.
/**
* Updates the month headers based on the given start month
*/
public void updateMonthColumns(Month startMonth) {
Month month = startMonth;
for (int i = 0; i != MONTHS_TO_SHOW; ++i) {
getColumnModel().setColumnHeader(i + 1, formatHeader(month));
getColumnModel().setDataIndex(i + 1, IndicatorRowDTO.propertyName(month));
month = month.next();
}
}
use of org.activityinfo.model.type.time.Month in project activityinfo by bedatadriven.
the class MonthlyReportsPanel method getInitialStartMonth.
private Month getInitialStartMonth(SiteDTO site) {
String stateKey = "monthlyView" + site.getActivityId() + "startMonth";
if (StateManager.get().getString(stateKey) != null) {
try {
return Month.parseMonth(StateManager.get().getString(stateKey));
} catch (NumberFormatException e) {
}
}
DateWrapper today = new DateWrapper();
return new Month(today.getFullYear(), today.getMonth());
}
Aggregations