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

int32_t Calendar::weekNumber ( int32_t  dayOfPeriod,
int32_t  dayOfWeek 
) [inline, protected, inherited]

Return the week number of a day, within a period. This may be the week number in a year, or the week number in a month. Usually this will be a value >= 1, but if some initial days of the period are excluded from week 1, because getMinimalDaysInFirstWeek is > 1, then the week number will be zero for those initial days. This method requires the day of week for the given date in order to determine the result.

This method is intended for use by subclasses in implementing their computeTime and/or computeFields methods. It is often useful in getActualMinimum and getActualMaximum as well.

dayOfPeriod The DAY_OF_YEAR or DAY_OF_MONTH whose week number is desired. Should be 1 for the first day of the period.
dayOfWeek The DAY_OF_WEEK for the day corresponding to the dayOfPeriod parameter. 1-based with 1=Sunday.
The week number (one-based), or zero if the day falls before the first week because getMinimalDaysInFirstWeek is more than one.

For internal use only.

Definition at line 2179 of file calendar.h.

References Calendar::weekNumber().

  return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);

Generated by  Doxygen 1.6.0   Back to index