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

void Calendar::add ( EDateFields  field,
int32_t  amount,
UErrorCode status 
) [virtual, inherited]

UDate Arithmetic function. Adds the specified (signed) amount of time to the given time field, based on the calendar's rules. For example, to subtract 5 days from the current time of the calendar, call add(Calendar::DATE, -5). When adding on the month or Calendar::MONTH field, other fields like date might conflict and need to be changed. For instance, adding 1 month on the date 01/31/96 will result in 02/29/96.

Parameters:
fieldSpecifies which date field to modify.
amountThe amount of time to be added to the field, in the natural unit for that field (e.g., days for the day fields, hours for the hour field.)
statusOutput 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.
Deprecated:
ICU 2.6. use add(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead.

Reimplemented in HebrewCalendar, and ChineseCalendar.

Definition at line 1794 of file calendar.cpp.

Referenced by Calendar::fieldDifference(), Calendar::getActualHelper(), CalendarRegressionTest::getAssociatedDate(), initializeSystemDefaultCentury(), CopticCalendar::initializeSystemDefaultCentury(), BuddhistCalendar::initializeSystemDefaultCentury(), EthiopicCalendar::initializeSystemDefaultCentury(), PersianCalendar::initializeSystemDefaultCentury(), IndianCalendar::initializeSystemDefaultCentury(), IslamicCalendar::initializeSystemDefaultCentury(), GregorianCalendar::initializeSystemDefaultCentury(), RelativeDateFormat::parse(), CalendarRegressionTest::test4040996(), CalendarRegressionTest::test4061476(), CalendarRegressionTest::test4073929(), CalendarRegressionTest::test4096539(), CalendarRegressionTest::test4103271(), CalendarRegressionTest::test4114578(), CalendarRegressionTest::test4125892(), CalendarRegressionTest::Test4165343(), CalendarRegressionTest::Test4197699(), CalendarTest::TestAdd520(), CalendarTest::TestAddRollExtensive(), CalendarTest::TestAddSetGet0610(), CalendarTest::TestAddSetOrder621(), CalendarRegressionTest::TestJ438(), CalendarRegressionTest::TestJ81(), DataDrivenCalendarTest::testOps(), CalendarTest::TestRog(), CalendarRegressionTest::TestTimeZoneTransitionAdd(), CalendarRegressionTest::TestWeekShift(), and CalendarTest::yearAddTest().

{
    Calendar::add((UCalendarDateFields)field, amount, status);
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index