use of org.joda.time.LocalDate in project cucumber-jvm by cucumber.
the class ParameterInfoTest method converts_with_custom_joda_time_transform_and_format.
@Test
public void converts_with_custom_joda_time_transform_and_format() throws NoSuchMethodException {
ParameterInfo parameterInfo = ParameterInfo.fromMethod(getClass().getMethod("withJodaTime", LocalDate.class)).get(0);
LocalDate aslaksBirthday = new LocalDate(1971, 2, 28);
assertEquals(aslaksBirthday, parameterInfo.convert("28/02/1971", FR));
assertEquals(aslaksBirthday, parameterInfo.convert("02/28/1971", US));
}
use of org.joda.time.LocalDate in project cucumber-jvm by cucumber.
the class ParameterInfoTest method converts_to_joda_time_using_object_ctor_and_default_locale.
@Test
public void converts_to_joda_time_using_object_ctor_and_default_locale() throws NoSuchMethodException {
ParameterInfo parameterInfo = ParameterInfo.fromMethod(getClass().getMethod("withJodaTimeWithoutTransform", LocalDate.class)).get(0);
LocalDate localDate = new LocalDate("1971");
assertEquals(localDate, parameterInfo.convert("1971", US));
}
use of org.joda.time.LocalDate in project cucumber-jvm by cucumber.
the class ParameterInfoTest method converts_with_custom_joda_time_transform.
@Test
public void converts_with_custom_joda_time_transform() throws NoSuchMethodException {
ParameterInfo parameterInfo = ParameterInfo.fromMethod(getClass().getMethod("withJodaTimeAndFormat", LocalDate.class)).get(0);
LocalDate aslaksBirthday = new LocalDate(1971, 2, 28);
assertEquals(aslaksBirthday, parameterInfo.convert("28/02/1971", FR));
assertEquals(aslaksBirthday, parameterInfo.convert("02/28/1971", US));
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountingDataController method showAccountingDataFor.
@RequestMapping("renderAccountingData.ftl")
public final ModelAndView showAccountingDataFor(@RequestParam(value = FROM_DATE) String paramFromDate, @RequestParam(value = TO_DATE) String paramToDate) {
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd");
LocalDate fromDate = fmt.parseDateTime(paramFromDate).toLocalDate();
LocalDate toDate = fmt.parseDateTime(paramToDate).toLocalDate();
Boolean hasAlreadyRanQuery = Boolean.FALSE;
String fileName = null;
List<AccountingDto> accountingData = new ArrayList<AccountingDto>();
try {
fileName = accountingService.getExportOutputFileName(fromDate, toDate).replace(".xml", "");
hasAlreadyRanQuery = accountingService.hasAlreadyRanQuery(fromDate, toDate);
accountingData = accountingService.getExportDetails(fromDate, toDate);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
ModelAndView mav = new ModelAndView("renderAccountingData");
List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "renderAccountingDataCacheInfo.ftl").withLink(fileName, "").build();
mav.addObject("breadcrumbs", breadcrumbs);
mav.addObject("accountingData", accountingData);
mav.addObject("hasAlreadyRanQuery", hasAlreadyRanQuery);
mav.addObject("fileName", fileName);
mav.addObject("fromDate", fromDate);
mav.addObject("toDate", toDate);
return mav;
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountBO method getDetailsOfInstallmentsInArrearsOn.
public List<AccountActionDateEntity> getDetailsOfInstallmentsInArrearsOn(LocalDate asOf) {
List<AccountActionDateEntity> installmentsInArrears = new ArrayList<AccountActionDateEntity>();
Set<AccountActionDateEntity> accountActionDates = getAccountActionDates();
if (accountActionDates != null && !accountActionDates.isEmpty()) {
for (AccountActionDateEntity accountAction : accountActionDates) {
LocalDate installmentDate = new LocalDate(accountAction.getActionDate());
if (asOf.isAfter(installmentDate) && !accountAction.isPaid() || asOf.isEqual(installmentDate)) {
installmentsInArrears.add(accountAction);
}
}
}
return installmentsInArrears;
}
Aggregations