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

void Calendar::computeGregorianAndDOWFields ( int32_t  julianDay,
UErrorCode ec 
) [private]

Compute the Gregorian calendar year, month, and day of month from the given Julian day. These values are not stored in fields, but in member variables gregorianXxx. Also compute the DAY_OF_WEEK and DOW_LOCAL fields.

Definition at line 1289 of file calendar.cpp.

References computeGregorianFields(), fFields, getFirstDayOfWeek(), internalSet(), julianDayToDayOfWeek(), UCAL_DAY_OF_WEEK, and UCAL_DOW_LOCAL.

Referenced by computeFields().

{
    computeGregorianFields(julianDay, ec);

    // Compute day of week: JD 0 = Monday
    int32_t dow = julianDayToDayOfWeek(julianDay);
    internalSet(UCAL_DAY_OF_WEEK,dow);

    // Calculate 1-based localized day of week
    int32_t dowLocal = dow - getFirstDayOfWeek() + 1;
    if (dowLocal < 1) {
        dowLocal += 7;
    }
    internalSet(UCAL_DOW_LOCAL,dowLocal);
    fFields[UCAL_DOW_LOCAL] = dowLocal;
}


Generated by  Doxygen 1.6.0   Back to index