Example usage for org.joda.time LocalDate dayOfWeek

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

Introduction

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

Prototype

public Property dayOfWeek() 

Source Link

Document

Get the day of week property which provides access to advanced functionality.

Usage

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

License:Apache License

/**
 * Return the name of the current period
 * @return String of current period//from  w  w w  .  j a v  a 2  s  .com
 */
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;
}

From source file:org.libreplan.business.calendars.entities.BaseCalendar.java

License:Open Source License

/**
 * Returns the number of workable hours for a specific week depending on the calendar restrictions.
 *
 * @param date/*from   w ww  .  j ava 2  s .c om*/
 * @return Workable hours per week
 */
public Integer getWorkableHoursPerWeek(LocalDate date) {
    LocalDate init = date.dayOfWeek().withMinimumValue();
    LocalDate end = date.dayOfWeek().withMaximumValue();
    return getWorkableHours(init, end);
}

From source file:org.libreplan.web.planner.chart.ChartFiller.java

License:Open Source License

private static LocalDate getThursdayOfThisWeek(LocalDate date) {
    return date.dayOfWeek().withMinimumValue().plusDays(DAYS_TO_THURSDAY);
}