Java Code Examples for org.joda.time.DateTimeConstants#NOVEMBER

The following examples show how to use org.joda.time.DateTimeConstants#NOVEMBER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BimonthlyExpiryDayValidator.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
protected int monthOfYear(int periodNumber) {
    switch (periodNumber) {
        case 1:
            return DateTimeConstants.JANUARY;
        case 2:
            return DateTimeConstants.MARCH;
        case 3:
            return DateTimeConstants.MAY;
        case 4:
            return DateTimeConstants.JULY;
        case 5:
            return DateTimeConstants.SEPTEMBER;
        case 6:
            return DateTimeConstants.NOVEMBER;
        default:
            return DateTimeConstants.JANUARY;

    }
}
 
Example 2
Source File: BimonthlyExpiryDayValidatorTest.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private String getPreviousPeriodStart() {
    int nowMonthOfYear = new LocalDate().getMonthOfYear();
    if (nowMonthOfYear >= DateTimeConstants.NOVEMBER) {
        return PREVIOUS_PERIOD_START_NOVEMBER;
    } else if (nowMonthOfYear >= DateTimeConstants.SEPTEMBER) {
        return PREVIOUS_PERIOD_START_SEPTEMBER;
    } else if (nowMonthOfYear >= DateTimeConstants.JULY) {
        return PREVIOUS_PERIOD_START_JULY;
    } else if (nowMonthOfYear >= DateTimeConstants.MAY) {
        return PREVIOUS_PERIOD_START_MAY;
    } else if (nowMonthOfYear >= DateTimeConstants.MARCH) {
        return PREVIOUS_PERIOD_START_MARCH;
    } else {
        return PREVIOUS_PERIOD_START_JANUARY;
    }
}
 
Example 3
Source File: BimonthlyExpiryDayValidatorTest.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private int monthStart(String previousPeriod) {
    switch (previousPeriod) {
        case PREVIOUS_PERIOD_START_JANUARY:
            return DateTimeConstants.JANUARY;
        case PREVIOUS_PERIOD_START_MARCH:
            return DateTimeConstants.MARCH;
        case PREVIOUS_PERIOD_START_MAY:
            return DateTimeConstants.MAY;
        case PREVIOUS_PERIOD_START_JULY:
            return DateTimeConstants.JULY;
        case PREVIOUS_PERIOD_START_SEPTEMBER:
            return DateTimeConstants.SEPTEMBER;
        case PREVIOUS_PERIOD_START_NOVEMBER:
            return DateTimeConstants.NOVEMBER;
        default:
            return DateTimeConstants.JANUARY;
    }
}