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

int32_t Calendar::getLocalDOW (  )  [protected, inherited]

returns the local DOW, valid range 0..6

For internal use only.

Definition at line 2765 of file calendar.cpp.

References Calendar::fFirstDayOfWeek, Calendar::internalGet(), Calendar::kDOWPrecedence, Calendar::resolveFields(), UCAL_DAY_OF_WEEK, and UCAL_DOW_LOCAL.

Referenced by Calendar::handleComputeJulianDay(), and Calendar::handleGetExtendedYearFromWeekFields().

{
  // Get zero-based localized DOW, valid range 0..6.  This is the DOW
    // we are looking for.
    int32_t dowLocal = 0;
    switch (resolveFields(kDOWPrecedence)) {
    case UCAL_DAY_OF_WEEK:
        dowLocal = internalGet(UCAL_DAY_OF_WEEK) - fFirstDayOfWeek;
        break;
    case UCAL_DOW_LOCAL:
        dowLocal = internalGet(UCAL_DOW_LOCAL) - 1;
        break;
    default:
        break;
    }
    dowLocal = dowLocal % 7;
    if (dowLocal < 0) {
        dowLocal += 7;
    }
    return dowLocal;
}


Generated by  Doxygen 1.6.0   Back to index