Example usage for org.joda.time YearMonth isAfter

List of usage examples for org.joda.time YearMonth isAfter

Introduction

In this page you can find the example usage for org.joda.time YearMonth isAfter.

Prototype

public boolean isAfter(ReadablePartial partial) 

Source Link

Document

Is this partial later than the specified partial.

Usage

From source file:com.court.handler.FxUtilsHandler.java

public static Predicate<MemberLoan> checkIfNotYetPaid(Function<MemberLoan, Date> check_date) {
    DateTimeZone zone = DateTimeZone.forID("Asia/Colombo");
    YearMonth ym_now = YearMonth.now(zone);

    return t -> {
        YearMonth ym_last = YearMonth.fromDateFields(new DateTime(check_date.apply(t), zone).toDate());
        //            if (t.getId() == 206) {
        //                YearMonth lastPaid = YearMonth.fromDateFields(new DateTime(check_date.apply(t), zone).toDate());
        //                System.out.println(ym_now.isAfter(lastPaid) || ym_now.isEqual(lastPaid));
        //                System.exit(0);
        //            }
        boolean flag = check_date.apply(t) != null
                ? (t.isContinuousPay() ? true : (ym_now.isAfter(ym_last) || ym_now.isEqual(ym_last)))
                : true;//from   w  ww. java 2  s .  co m
        // boolean flag = check_date.apply(t) != null ? (ym_now.isAfter(ym_last) || ym_now.isEqual(ym_last)) : true;
        return flag;
    };
}

From source file:org.openmrs.module.mirebalaisreports.fragment.controller.field.MonthSinceMirebalaisOpeningFragmentController.java

License:Open Source License

public void controller(FragmentModel model) {
    List<SimpleObject> months = new ArrayList<SimpleObject>();

    YearMonth earliest = new YearMonth(2013, 2);
    YearMonth month = new YearMonth().minusMonths(1);
    while (month.isAfter(earliest)) {
        months.add(SimpleObject.create("label", month.toString("MMM yyyy", Context.getLocale()), "value",
                month.toString("yyyy-MM-01")));
        month = month.minusMonths(1);//from  ww w.  j a  va 2 s  .co m
    }
    model.addAttribute("months", months);
}