// -------------------------------------
+UBool
+Calendar::inDaylightTime(UErrorCode& status) const
+{
+ if (U_FAILURE(status) || !getTimeZone().useDaylightTime()) {
+ return false;
+ }
+ // Force an update of the state of the Calendar.
+ ((Calendar*)this)->complete(status); // cast away const
+
+ return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
+}
+
+// -------------------------------------
/**
* Ensure that each field is within its valid range by calling {@link
return LIMITS[field][limitType];
}
-UBool
-CECalendar::inDaylightTime(UErrorCode& status) const
-{
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime()) {
- return false;
- }
-
- // Force an update of the state of the Calendar.
- ((CECalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
UBool
CECalendar::haveDefaultCentury() const
{
*/
virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override;
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode&) const override;
-
/**
* Returns true because Coptic/Ethiopic Calendar does have a default century
* @internal
}
-UBool
-ChineseCalendar::inDaylightTime(UErrorCode& status) const
-{
- // copied from GregorianCalendar
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
- return false;
-
- // Force an update of the state of the Calendar.
- ((ChineseCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
// default century
static UDate gSystemDefaultCenturyStart = DBL_MIN;
protected:
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
-
/**
* Returns true because the Islamic Calendar does have a default century
* @internal
}
-// -------------------------------------
-
-UBool
-GregorianCalendar::inDaylightTime(UErrorCode& status) const
-{
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
- return false;
-
- // Force an update of the state of the Calendar.
- ((GregorianCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
// -------------------------------------
/**
return (int) (day + 347997);
}
-UBool
-HebrewCalendar::inDaylightTime(UErrorCode& status) const
-{
- // copied from GregorianCalendar
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
- return false;
-
- // Force an update of the state of the Calendar.
- ((HebrewCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
/**
* The system maintains a static default century start date and Year. They are
* initialized the first time they are used. Once the system default century date
virtual void validateField(UCalendarDateFields field, UErrorCode &status) override;
protected:
-
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
/**
* Returns true because the Hebrew Calendar does have a default century
* @internal
internalSet(UCAL_DAY_OF_YEAR, yday + 1); // yday is 0-based
}
-UBool
-IndianCalendar::inDaylightTime(UErrorCode& status) const
-{
- // copied from GregorianCalendar
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime()) {
- return false;
- }
-
- // Force an update of the state of the Calendar.
- ((IndianCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
-
/**
* The system maintains a static default century start date and Year. They are
* initialized the first time they are used. Once the system default century date
// Default century.
protected:
-
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
-
/**
* Returns true because the Indian Calendar does have a default century
* @internal
internalSet(UCAL_DAY_OF_YEAR, dayOfYear);
}
-UBool
-IslamicCalendar::inDaylightTime(UErrorCode& status) const
-{
- // copied from GregorianCalendar
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
- return false;
-
- // Force an update of the state of the Calendar.
- ((IslamicCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
/**
* The system maintains a static default century start date and Year. They are
* initialized the first time they are used. Once the system default century date
// Default century.
protected:
-
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
-
/**
* Returns true because the Islamic Calendar does have a default century
* @internal
internalSet(UCAL_DAY_OF_YEAR, dayOfYear);
}
-UBool
-PersianCalendar::inDaylightTime(UErrorCode& status) const
-{
- // copied from GregorianCalendar
- if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
- return false;
-
- // Force an update of the state of the Calendar.
- ((PersianCalendar*)this)->complete(status); // cast away const
-
- return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : false);
-}
-
// default century
static UDate gSystemDefaultCenturyStart = DBL_MIN;
PersianCalendar(); // default constructor not implemented
protected:
-
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @internal
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
/**
* Returns true because the Persian Calendar does have a default century
* @internal
* false, otherwise.
* @stable ICU 2.0
*/
- virtual UBool inDaylightTime(UErrorCode& status) const = 0;
+ virtual UBool inDaylightTime(UErrorCode& status) const;
/**
* Specifies whether or not date/time interpretation is to be lenient. With lenient
*/
virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const override;
- /**
- * (Overrides Calendar) Return true if the current date for this Calendar is in
- * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
- *
- * @param status Fill-in parameter which receives the status of this operation.
- * @return True if the current date for this Calendar is in Daylight Savings Time,
- * false, otherwise.
- * @stable ICU 2.0
- */
- virtual UBool inDaylightTime(UErrorCode& status) const override;
-
public:
/**