Example usage for org.joda.time DateTime getYear

List of usage examples for org.joda.time DateTime getYear

Introduction

In this page you can find the example usage for org.joda.time DateTime getYear.

Prototype

public int getYear() 

Source Link

Document

Get the year field value.

Usage

From source file:kr.debop4j.timeperiod.timerange.YearRange.java

License:Apache License

/**
 * Instantiates a new Year range./*w  w  w  .j  a v  a  2 s .com*/
 *
 * @param moment   the moment
 * @param calendar the calendar
 */
public YearRange(DateTime moment, ITimeCalendar calendar) {
    this(moment.getYear(), calendar);
}

From source file:kr.debop4j.timeperiod.timerange.YearTimeRange.java

License:Apache License

/**
 * Instantiates a new Year time range./*from  w ww. j av  a  2  s .  c  om*/
 *
 * @param moment    the moment
 * @param yearCount the year count
 * @param calendar  the calendar
 */
public YearTimeRange(DateTime moment, int yearCount, ITimeCalendar calendar) {
    this(moment.getYear(), yearCount, calendar);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**
 * Gets year of.//from   w w  w . j ava  2 s.c  o  m
 *
 * @param moment the moment
 * @return the year of
 */
public static int getYearOf(DateTime moment) {
    return getYearOf(moment.getYear(), moment.getMonthOfYear());
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**
 * ? ??? (Year)  ? ?.//from  w w  w. j ava2  s. c  o  m
 *
 * @param left  the left
 * @param right the right
 * @return the boolean
 */
public static boolean isSameYear(DateTime left, DateTime right) {
    return left.getYear() == right.getYear();
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**  ?? ? ? ? */
public static DateTime currentHalfyear() {
    DateTime now = now();
    Halfyear halfyear = getHalfyearOfMonth(now.getMonthOfYear());
    int month = getMonthsOfHalfyear(halfyear)[0];

    return asDate(now.getYear(), month, 1);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**  ?? ? ? ? */
public static DateTime currentQuarter() {
    DateTime now = now();
    Quarter quarter = getQuarterOfMonth(now.getMonthOfYear());
    int month = getMonthsOfQuarter(quarter)[0];

    return asDate(now.getYear(), month, 1);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/** moment  ? ??  ? */
public static DateTime startTimeOfYear(DateTime moment) {
    return new DateTime(moment.getYear(), 1, 1, 0, 0);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/** moment ? ??  ? */
public static DateTime endTimeOfYear(DateTime moment) {
    return startTimeOfYear(moment.getYear() + 1).plusMillis(-1);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**   ? */
public static DateTime startTimeOfLastYear(DateTime moment) {
    return startTimeOfYear(moment.getYear() - 1);
}

From source file:kr.debop4j.timeperiod.tools.Times.java

License:Apache License

/**   ? */
public static DateTime endTimeOfLastYear(DateTime moment) {
    return endTimeOfYear(moment.getYear() - 1);
}