Example usage for org.joda.time LocalDate weekOfWeekyear

List of usage examples for org.joda.time LocalDate weekOfWeekyear

Introduction

In this page you can find the example usage for org.joda.time LocalDate weekOfWeekyear.

Prototype

public Property weekOfWeekyear() 

Source Link

Document

Get the week of a week based year property which provides access to advanced functionality.

Usage

From source file:com.splicemachine.db.iapi.types.SQLDate.java

License:Apache License

/**
 * Get the week of year from the encodedDate,
  * 1-52./* www.  j  av  a 2s  .co m*/
 *
 * @param encodedDate   the encoded date
 * @return             week day name.
 */
static int getWeek(int encodedDate) {
    LocalDate date = new LocalDate(getYear(encodedDate), getMonth(encodedDate), getDay(encodedDate));
    return date.weekOfWeekyear().get();
}

From source file:org.gnucash.android.model.Recurrence.java

License:Apache License

/**
 * Return the name of the current period
 * @return String of current period//w  ww .  java 2s .c o m
 */
public String getTextOfCurrentPeriod(int periodNum) {
    LocalDate startDate = new LocalDate(mPeriodStart.getTime());
    switch (mPeriodType) {

    case DAY:
        return startDate.dayOfWeek().getAsText();
    case WEEK:
        return startDate.weekOfWeekyear().getAsText();
    case MONTH:
        return startDate.monthOfYear().getAsText();
    case YEAR:
        return startDate.year().getAsText();
    }
    return "Period " + periodNum;
}