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

void Calendar::roll ( EDateFields  field,
UBool  up,
UErrorCode status 
) [inline, inherited]

Time Field Rolling function. Rolls (up/down) a single unit of time on the given time field. For example, to roll the current date up by one day, call roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it will roll the year value in the range between getMinimum(Calendar::YEAR) and the value returned by getMaximum(Calendar::YEAR). When rolling on the month or Calendar::MONTH field, other fields like date might conflict and, need to be changed. For instance, rolling the month up on the date 01/31/96 will result in 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range between 0 and 23, which is zero-based.

NOTE: Do not use this method -- use roll(EDateFields, int, UErrorCode&) instead.

field The time field.
up Indicates if the value of the specified time field is to be rolled up or rolled down. Use true if rolling up, false otherwise.
status Output param set to success/failure code on exit. If any value previously set in the time field is invalid or restricted by leniency, this will be set to an error status.
ICU 2.6. Use roll(UCalendarDateFields field, UBool up, UErrorCode& status) instead.

Definition at line 2158 of file calendar.h.

Referenced by HebrewCalendar::roll(), GregorianCalendar::roll(), ChineseCalendar::roll(), Calendar::roll(), and CalendarRegressionTest::test4114578().

    roll((UCalendarDateFields) field, up, status);

Generated by  Doxygen 1.6.0   Back to index