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

The following examples show how to use org.joda.time.DateTimeConstants#JANUARY . 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: 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 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;
    }
}
 
Example 4
Source File: SixMonthlyExpiryDayValidator.java    From dhis2-android-datacapture with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected int monthOfYear(int periodNumber) {
    if (periodNumber == 1) {
        return DateTimeConstants.JANUARY;
    } else {
        return DateTimeConstants.JULY;
    }
}
 
Example 5
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;
    }
}