ICU-3805 Move the usage of an internal function to an implementation file.

X-SVN-Rev: 16385
This commit is contained in:
George Rhoten 2004-10-02 03:58:10 +00:00
parent 164b735f3f
commit 4dee03aead
2 changed files with 9 additions and 10 deletions

View File

@ -1146,6 +1146,15 @@ void Calendar::computeFields(UErrorCode &ec)
fFields[UCAL_DST_OFFSET] = dstOffset;
}
uint8_t Calendar::julianDayToDayOfWeek(double julian)
{
// If julian is negative, then julian%7 will be negative, so we adjust
// accordingly. We add 1 because Julian day 0 is Monday.
int8_t dayOfWeek = (int8_t) uprv_fmod(julian + 1, 7);
uint8_t result = (uint8_t)(dayOfWeek + ((dayOfWeek < 0) ? (7+UCAL_SUNDAY ) : UCAL_SUNDAY));
return result;
}
/**
* Compute the Gregorian calendar year, month, and day of month from

View File

@ -2157,16 +2157,6 @@ Calendar::internalSet(EDateFields field, int32_t value)
internalSet((UCalendarDateFields) field, value);
}
inline uint8_t Calendar::julianDayToDayOfWeek(double julian)
{
// If julian is negative, then julian%7 will be negative, so we adjust
// accordingly. We add 1 because Julian day 0 is Monday.
int8_t dayOfWeek = (int8_t) uprv_fmod(julian + 1, 7);
uint8_t result = (uint8_t)(dayOfWeek + ((dayOfWeek < 0) ? (7+UCAL_SUNDAY ) : UCAL_SUNDAY));
return result;
}
inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)
{
return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);