Example usage for org.joda.time YearMonth now

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

Introduction

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

Prototype

public static YearMonth now(Chronology chronology) 

Source Link

Document

Obtains a YearMonth set to the current system millisecond time using the specified chronology.

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  .j  a  v  a2s .c o m*/
        // boolean flag = check_date.apply(t) != null ? (ym_now.isAfter(ym_last) || ym_now.isEqual(ym_last)) : true;
        return flag;
    };
}