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

The following examples show how to use org.joda.time.DateTimeConstants#APRIL . 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: QuarterlyExpiryDayValidator.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
protected int monthOfYear(int periodNumber) {
    switch (periodNumber) {
        case 1:
            return DateTimeConstants.JANUARY;
        case 2:
            return DateTimeConstants.APRIL;
        case 3:
            return DateTimeConstants.JULY;
        case 4:
            return DateTimeConstants.OCTOBER;
        default:
            return DateTimeConstants.JANUARY;

    }
}
 
Example 2
Source File: SixMonthlyAprilExpiryDayValidator.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
protected int monthOfYear(int period) {
    if (period == 1) {
        return DateTimeConstants.APRIL;
    } else {
        return DateTimeConstants.OCTOBER;
    }
}
 
Example 3
Source File: QuarterlyExpiryDayValidatorTest.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private int getPreviousPeriodStart() {
    int nowMonthOfYear = new LocalDate().getMonthOfYear();
    if (nowMonthOfYear >= DateTimeConstants.OCTOBER) {
        return PREVIOUS_PERIOD_START_OCTOBER;
    } else if (nowMonthOfYear >= DateTimeConstants.JULY) {
        return PREVIOUS_PERIOD_START_JULY;
    } else if (nowMonthOfYear >= DateTimeConstants.APRIL) {
        return PREVIOUS_PERIOD_START_APRIL;
    } else {
        return PREVIOUS_PERIOD_START_JANUARY;
    }
}
 
Example 4
Source File: QuarterlyExpiryDayValidatorTest.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private int monthStart(int previousPeriod) {
    switch (previousPeriod) {
        case PREVIOUS_PERIOD_START_JANUARY:
            return DateTimeConstants.JANUARY;
        case PREVIOUS_PERIOD_START_APRIL:
            return DateTimeConstants.APRIL;
        case PREVIOUS_PERIOD_START_JULY:
            return DateTimeConstants.JULY;
        case PREVIOUS_PERIOD_START_OCTOBER:
            return DateTimeConstants.OCTOBER;
        default:
            return DateTimeConstants.JANUARY;
    }
}
 
Example 5
Source File: FinancialYearAprilExpiryDayValidator.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected int monthOfYear() {
    return DateTimeConstants.APRIL;
}