Logo Search packages:      
Sourcecode: icu version File versions  Download package

void EthiopicCalendar::handleComputeFields ( int32_t  julianDay,
UErrorCode status 
) [protected, virtual]

Compute fields from the JD

For internal use only.

Reimplemented from Calendar.

Definition at line 102 of file ethpccal.cpp.

References getJDEpochOffset(), Calendar::internalSet(), isAmeteAlemEra(), CECalendar::jdToCE(), UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_ERA, UCAL_EXTENDED_YEAR, UCAL_MONTH, and UCAL_YEAR.

{
    int32_t eyear, month, day, era, year;
    jdToCE(julianDay, getJDEpochOffset(), eyear, month, day);

    if (isAmeteAlemEra()) {
        era = AMETE_ALEM;
        year = eyear + AMETE_MIHRET_DELTA;
    } else {
        if (eyear > 0) {
            era = AMETE_MIHRET;
            year = eyear;
        } else {
            era = AMETE_ALEM;
            year = eyear + AMETE_MIHRET_DELTA;
        }
    }

    internalSet(UCAL_EXTENDED_YEAR, eyear);
    internalSet(UCAL_ERA, era);
    internalSet(UCAL_YEAR, year);
    internalSet(UCAL_MONTH, month);
    internalSet(UCAL_DATE, day);
    internalSet(UCAL_DAY_OF_YEAR, (30 * month) + day);
}


Generated by  Doxygen 1.6.0   Back to index