List of usage examples for org.joda.time LocalDate weekOfWeekyear
public Property weekOfWeekyear()
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; }