ItEr38S08CUAdministracionCategoriaCosteItEr37S12: solved a bug when comparing time intervals with init date on a one-digit month or day

This commit is contained in:
Jacobo Aragunde Pérez 2009-12-08 12:50:35 +01:00 committed by Javier Moran Rua
parent 24056465c1
commit 92899ccbe7
2 changed files with 16 additions and 8 deletions

View file

@ -287,8 +287,10 @@ public class CostCategoryCRUDController extends GenericForwardComposer
// Updates the constraint of the endDate box with the new date
LocalDate initDate = ((HourCost)row.getValue()).getInitDate();
Datebox endDateBox = (Datebox) row.getChildren().get(3);
endDateBox.setConstraint("after " + initDate.getYear() +
initDate.getMonthOfYear() + initDate.getDayOfMonth());
endDateBox.setConstraint("after " +
String.format("%04d", initDate.getYear()) +
String.format("%02d", initDate.getMonthOfYear()) +
String.format("%02d", initDate.getDayOfMonth()));
}
});
}
@ -338,8 +340,10 @@ public class CostCategoryCRUDController extends GenericForwardComposer
bindDateboxEndDate(endDateBox, (HourCost) row.getValue());
LocalDate initDate = ((HourCost)row.getValue()).getInitDate();
if (initDate != null) {
endDateBox.setConstraint("after " + initDate.getYear() +
initDate.getMonthOfYear() + initDate.getDayOfMonth());
endDateBox.setConstraint("after " +
String.format("%04d", initDate.getYear()) +
String.format("%02d", initDate.getMonthOfYear()) +
String.format("%02d", initDate.getDayOfMonth()));
}
row.appendChild(endDateBox);
}

View file

@ -184,8 +184,10 @@ public class ResourcesCostCategoryAssignmentController extends GenericForwardCom
// Updates the constraint of the endDate box with the new date
LocalDate initDate = ((ResourcesCostCategoryAssignment)row.getValue()).getInitDate();
Datebox endDateBox = (Datebox) row.getChildren().get(2);
endDateBox.setConstraint("after " + initDate.getYear() +
initDate.getMonthOfYear() + initDate.getDayOfMonth());
endDateBox.setConstraint("after " +
String.format("%04d", initDate.getYear()) +
String.format("%02d", initDate.getMonthOfYear()) +
String.format("%02d", initDate.getDayOfMonth()));
}
});
}
@ -235,8 +237,10 @@ public class ResourcesCostCategoryAssignmentController extends GenericForwardCom
bindDateboxEndDate(endDateBox, (ResourcesCostCategoryAssignment) row.getValue());
LocalDate initDate = ((ResourcesCostCategoryAssignment)row.getValue()).getInitDate();
if (initDate != null) {
endDateBox.setConstraint("after " + initDate.getYear() +
initDate.getMonthOfYear() + initDate.getDayOfMonth());
endDateBox.setConstraint("after " +
String.format("%04d", initDate.getYear()) +
String.format("%02d", initDate.getMonthOfYear()) +
String.format("%02d", initDate.getDayOfMonth()));
}
row.appendChild(endDateBox);
}