Home | History | Annotate | Download | only in unicode

Lines Matching defs:Calendar

7 * File CALENDAR.H
32 * \brief C++ API: Calendar object
52 * <code>Calendar</code> is an abstract base class for converting between
60 * Subclasses of <code>Calendar</code> interpret a <code>UDate</code>
61 * according to the rules of a specific calendar system.
62 * The most commonly used subclass of <code>Calendar</code> is
71 * Like other locale-sensitive classes, <code>Calendar</code> provides a
73 * object of this type. <code>Calendar</code>'s <code>createInstance</code> method
74 * returns the appropriate <code>Calendar</code> subclass whose
78 * Calendar *rightNow = Calendar::createInstance(errCode);
83 * A <code>Calendar</code> object can produce all the time field values
85 * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
95 * <strong>Insufficient information.</strong> The calendar will use default
96 * information to specify the missing fields. This may vary by calendar; for
97 * the Gregorian calendar, the default for a field is the same as that of the
101 * <strong>Inconsistent information.</strong> If fields conflict, the calendar
103 * determining the day, the calendar will look for one of the following
129 * specification of the historial Arabic astronomical calendar requires year,
147 * calendar, as those must be modifiable or overridable by the user at
152 * <code>Calendar</code> provides an API for field "rolling", where fields
158 * <code>Calendar</code> also provides a date arithmetic function for
165 class U_I18N_API Calendar : public UObject {
169 * Field IDs for date and time. Used to specify date/time fields. ERA is calendar
170 * specific. Example ranges given are for illustration only; see specific Calendar
212 * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
230 * Useful constants for month. Note: Calendar month is 0-based.
266 virtual ~Calendar();
269 * Create and return a polymorphic copy of this calendar.
271 * @return a polymorphic copy of this calendar.
274 virtual Calendar* clone(void) const = 0;
277 * Creates a Calendar using the default timezone and locale. Clients are responsible
280 * @param success Indicates the success/failure of Calendar creation. Filled in
283 * requests a calendar type which has not been installed.
284 * @return A Calendar if created successfully. NULL otherwise.
287 static Calendar* U_EXPORT2 createInstance(UErrorCode& success);
290 * Creates a Calendar using the given timezone and the default locale.
291 * The Calendar takes ownership of zoneToAdopt; the
295 * @param success Indicates the success/failure of Calendar creation. Filled in
298 * @return A Calendar if created successfully. NULL otherwise.
301 static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
304 * Creates a Calendar using the given timezone and the default locale. The TimeZone
308 * @param success Indicates the success/failure of Calendar creation. Filled in
311 * @return A Calendar if created successfully. NULL otherwise.
314 static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, UErrorCode& success);
317 * Creates a Calendar using the default timezone and the given locale.
320 * @param success Indicates the success/failure of Calendar creation. Filled in
323 * @return A Calendar if created successfully. NULL otherwise.
326 static Calendar* U_EXPORT2 createInstance(const Locale& aLocale, UErrorCode& success);
329 * Creates a Calendar using the given timezone and given locale.
330 * The Calendar takes ownership of zoneToAdopt; the
335 * @param success Indicates the success/failure of Calendar creation. Filled in
338 * @return A Calendar if created successfully. NULL otherwise.
341 static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
344 * Gets a Calendar using the given timezone and given locale. The TimeZone
349 * @param success Indicates the success/failure of Calendar creation. Filled in
352 * @return A Calendar if created successfully. NULL otherwise.
355 static Calendar* U_EXPORT2 createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
376 * "calendar" is supported.
398 * Gets this Calendar's time as milliseconds. May involve recalculation of time due
413 * Sets this Calendar's current time with the given UDate. The time specified should
425 * Compares the equality of two Calendar objects. Objects of different subclasses
426 * are considered unequal. This comparison is very exacting; two Calendar objects
430 * @param that The Calendar object to be compared with.
431 * @return True if the given Calendar is the same as this Calendar; false
435 virtual UBool operator==(const Calendar& that) const;
438 * Compares the inequality of two Calendar objects.
440 * @param that The Calendar object to be compared with.
441 * @return True if the given Calendar is not the same as this Calendar; false
445 UBool operator!=(const Calendar& that) const {return !operator==(that);}
448 * Returns TRUE if the given Calendar object is equivalent to this
449 * one. An equivalent Calendar will behave exactly as this one
451 * the operator==() method to return TRUE, the other Calendar must
454 * @param other the Calendar to be compared with this Calendar
457 virtual UBool isEquivalentTo(const Calendar& other) const;
460 * Compares the Calendar time, whereas Calendar::operator== compares the equality of
461 * Calendar objects.
463 * @param when The Calendar to be compared with this Calendar. Although this is a
469 * @return True if the current time of this Calendar is equal to the time of
470 * Calendar when; false otherwise.
473 UBool equals(const Calendar& when, UErrorCode& status) const;
476 * Returns true if this Calendar's current time is before "when"'s current time.
478 * @param when The Calendar to be compared with this Calendar. Although this is a
484 * @return True if the current time of this Calendar is before the time of
485 * Calendar when; false otherwise.
488 UBool before(const Calendar& when, UErrorCode& status) const;
491 * Returns true if this Calendar's current time is after "when"'s current time.
493 * @param when The Calendar to be compared with this Calendar. Although this is a
499 * @return True if the current time of this Calendar is after the time of
500 * Calendar when; false otherwise.
503 UBool after(const Calendar& when, UErrorCode& status) const;
507 * time field, based on the calendar's rules. For example, to subtract 5 days from
508 * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
509 * the month or Calendar::MONTH field, other fields like date might conflict and
526 * time field, based on the calendar's rules. For example, to subtract 5 days from
527 * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
528 * the month or Calendar::MONTH field, other fields like date might conflict and
546 * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
547 * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
548 * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
549 * Calendar::MONTH field, other fields like date might conflict and, need to be
552 * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
553 * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
571 * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
572 * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
573 * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
574 * Calendar::MONTH field, other fields like date might conflict and, need to be
577 * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
578 * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
596 * roll(Calendar::DATE, +1, status). When rolling on the month or
597 * Calendar::MONTH field, other fields like date might conflict and, need to be
601 * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
620 * roll(Calendar::DATE, +1, status). When rolling on the month or
621 * Calendar::MONTH field, other fields like date might conflict and, need to be
625 * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
643 * calendar object is set to. If this calendar is set
645 * positive. If this calendar is set <em>after</em> the given
649 * Calendar::MONTH)</code> returns 3, then this calendar is set to
653 * <p>As a side effect of this call, this calendar is advanced
663 * int y = cal->fieldDifference(when, Calendar::YEAR, err);
664 * int m = cal->fieldDifference(when, Calendar::MONTH, err);
665 * int d = cal->fieldDifference(when, Calendar::DATE, err);</pre>
675 * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
676 * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
678 * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
679 * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);</pre>
683 * irregularities in the underlying calendar system (e.g., the
684 * Gregorian calendar has a varying number of days per month).
686 * @param when the date to compare this calendar's time to
692 * this calendar's time and <code>when</code>, in terms of
700 * calendar object is set to. If this calendar is set
702 * positive. If this calendar is set <em>after</em> the given
706 * Calendar::MONTH)</code> returns 3, then this calendar is set to
710 * <p>As a side effect of this call, this calendar is advanced
720 * int y = cal->fieldDifference(when, Calendar::YEAR, err);
721 * int m = cal->fieldDifference(when, Calendar::MONTH, err);
722 * int d = cal->fieldDifference(when, Calendar::DATE, err);</pre>
732 * int m1 = cal->fieldDifference(date2, Calendar::MONTH, err);
733 * int d1 = cal->fieldDifference(date2, Calendar::DATE, err);
735 * int m2 = cal->fieldDifference(date1, Calendar::MONTH, err);
736 * int d2 = cal->fieldDifference(date1, Calendar::DATE, err);</pre>
740 * irregularities in the underlying calendar system (e.g., the
741 * Gregorian calendar has a varying number of days per month).
743 * @param when the date to compare this calendar's time to
749 * this calendar's time and <code>when</code>, in terms of
756 * Sets the calendar's time zone to be the one passed in. The Calendar takes ownership
766 * Sets the calendar's time zone to be the same as the one passed in. The TimeZone
775 * Returns a reference to the time zone owned by this calendar. The returned reference
777 * or this Calendar is destroyed.
779 * @return The time zone object associated with this calendar.
785 * Returns the time zone owned by this calendar. The caller owns the returned object
787 * with this Calendar is the default TimeZone as returned by TimeZone::createDefault().
789 * @return The time zone object which was associated with this calendar.
795 * Queries if the current date for this Calendar is in Daylight Savings Time.
798 * @return True if the current date for this Calendar is in Daylight Savings Time,
963 * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
965 * The version of this function on Calendar uses an iterative algorithm to determine the
972 * @return the minimum of the given field for the current date of this Calendar
979 * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
981 * The version of this function on Calendar uses an iterative algorithm to determine the
988 * @return the minimum of the given field for the current date of this Calendar
996 * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
999 * The version of this function on Calendar uses an iterative algorithm to determine the
1006 * @return the maximum of the given field for the current date of this Calendar
1014 * maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
1017 * The version of this function on Calendar uses an iterative algorithm to determine the
1024 * @return the maximum of the given field for the current date of this Calendar
1061 * resolving of time in Calendar. Unset fields have a value of zero, by definition.
1071 * resolving of time in Calendar. Unset fields have a value of zero, by definition.
1171 * Concrete subclasses of Calendar must implement getDynamicClassID() and also a
1184 * Returns the resource key string used for this calendar type.
1196 * in this calendar system. If a transition occurs at midnight,
1212 * this calendar system. If getDayOfWeekType() rerturns UCAL_WEEKEND_ONSET
1228 * this calendar system.
1232 * this calendar system, FALSE otherwise.
1238 * Returns TRUE if this Calendar's current date-time is in the weekend in
1239 * this calendar system.
1240 * @return TRUE if this Calendar's current date-time is in the weekend in
1241 * this calendar system, FALSE otherwise.
1249 * Constructs a Calendar with the default time zone as returned by
1252 * @param success Indicates the status of Calendar object construction. Returns
1256 Calendar(UErrorCode& success);
1261 * @param source Calendar object to be copied from
1264 Calendar(const Calendar& source);
1269 * @param right Calendar object to be copied
1272 Calendar& operator=(const Calendar& right);
1275 * Constructs a Calendar with the given time zone and locale. Clients are no longer
1280 * @param success Indicates the status of Calendar object construction. Returns
1284 Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success);
1287 * Constructs a Calendar with the given time zone and locale.
1291 * @param success Indicates the status of Calendar object construction. Returns
1295 Calendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
1298 * Converts Calendar's time field values to GMT as milliseconds.
1309 * time field values with a new time that is set for the calendar. This method
1321 * Gets this Calendar's current time as a long.
1332 * Sets this Calendar's current time from the given long value.
1407 * Prepare this calendar for computing the actual minimum or maximum.
1408 * This method modifies this calendar's fields; it is called on a
1409 * temporary calendar.
1462 * this method to implement their calendar system.
1477 * year of this calendar system. Subclasses should override this
1479 * implementation than the default implementation in Calendar.
1486 * calendar system. Subclasses should override this method if they can
1488 * default implementation in Calendar.
1497 * as UCAL_ERA) specific to the calendar system, depending on which set of
1506 * handleGetMonthLength() to obtain the calendar-specific month
1509 * @return julian day specified by calendar fields.
1518 * The Calendar implementation assumes yearWoy is in extended gregorian form
1653 * The flag which indicates if the current time is set in the calendar.
1659 * True if the fields are in sync with the currently set time of this Calendar.
1679 * computed. This occurs only in setTimeInMillis(). A calendar set
1710 * The flags which tell if a specified time field for the calendar is set.
1734 * specific to each calendar system. These are:
1745 * the getGregorianXxx() methods to obtain Gregorian calendar
1752 * <p>The default implementation in <code>Calendar</code> implements
1753 * a pure proleptic Gregorian calendar.
1759 * Return the extended year on the Gregorian calendar as computed by
1768 * Return the month (0-based) on the Gregorian calendar as computed by
1777 * Return the day of year (1-based) on the Gregorian calendar as
1786 * Return the day of month (1-based) on the Gregorian calendar as
1819 * the allowable range for the date to which this calendar is set.
1820 * For example, in a Gregorian calendar pinning the {@link #UCalendarDateFields DAY_OF_MONTH}
1821 * field for a calendar set to April 31 would cause it to be set
1838 * @param field The calendar field whose value should be pinned.
1940 * The current time set for the calendar.
1950 * Time zone affects the time calculation done by Calendar. Calendar subclasses use
1958 * must be set when a Calendar is constructed. For example, in US locale,
1961 * a Calendar is constructed.
1971 * Sets firstDayOfWeek and minimalDaysInFirstWeek. Called at Calendar construction
1975 * @param type The calendar type identifier, e.g: gregorian, buddhist, etc.
2024 * Compute the Gregorian calendar year, month, and day of month from
2034 * Compute the Gregorian calendar year, month, and day of month from the
2038 * method to perform a Gregorian calendar millis->fields computation.
2048 * subclass based on the calendar system.
2055 * is part of a calendar system with an N-year cycle field CYCLE, then
2062 * proleptic Gregorian calendar, which has no field larger than a year.
2070 * should only be called if this calendar is not lenient.
2078 * Validate a single field of this calendar. Subclasses should
2079 * override this method to validate any calendar-specific fields.
2081 * <code>Calendar.validateField()</code>.
2088 * Validate a single field of this calendar given its minimum and
2128 * Register a new Calendar factory. The factory will be adopted.
2150 * Multiple Calendar Implementation
2156 * Multiple Calendar Implementation
2162 * Multiple Calendar Implementation
2170 * @return TRUE if this calendar has a default century (i.e. 03 -> 2003)
2185 /** Get the locale for this calendar object. You can choose between valid and actual locale.
2193 /** Get the locale for this calendar object. You can choose between valid and actual locale.
2205 inline Calendar*
2206 Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode)
2215 Calendar::roll(UCalendarDateFields field, UBool up, UErrorCode& status)
2221 Calendar::roll(EDateFields field, UBool up, UErrorCode& status)
2235 Calendar::internalSet(UCalendarDateFields field, int32_t value)
2242 inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)