+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
* Copyright (C) 2003-2008, International Business Machines Corporation
* July 30, 1912 (Taisho), December 25, 1926 (Showa), and January 7, 1989 (Heisei). Constants
* for these eras, suitable for use in the <code>UCAL_ERA</code> field, are provided
* in this class. Note that the <em>number</em> used for each era is more or
- * less arbitrary. Currently, the era starting in 1053 AD is era #0; however this
- * may change in the future as we add more historical data. Use the predefined
- * constants rather than using actual, absolute numbers.
+ * less arbitrary. Currently, the era starting in 645 AD is era #0; however this
+ * may change in the future. Use the predefined constants rather than using actual,
+ * absolute numbers.
* <p>
+ * Since ICU4C 63, start date of each era is imported from CLDR. CLDR era data
+ * may contain tentative era in near future with placeholder names. By default,
+ * such era data is not enabled. ICU4C users who want to test the behavior of
+ * the future era can enable this one of following settings (in the priority
+ * order):
+ * <ol>
+ * <li>Environment variable <code>ICU_ENABLE_TENTATIVE_ERA=true</code>.</li>
+ * </nl>
* @internal
*/
class JapaneseCalendar : public GregorianCalendar {
public:
/**
- * Useful constants for JapaneseCalendar.
+ * Check environment variable.
+ * @internal
+ */
+ U_I18N_API static UBool U_EXPORT2 enableTentativeEra(void);
+
+ /**
+ * Useful constants for JapaneseCalendar.
+ * Exported for use by test code.
* @internal
*/
U_I18N_API static uint32_t U_EXPORT2 getCurrentEra(void); // the current era
* Called by computeJulianDay. Returns the default month (0-based) for the year,
* taking year and era into account. Will return the first month of the given era, if
* the current year is an ascension year.
+ * @param eyear the extended year
* @internal
*/
- virtual int32_t getDefaultMonthInYear();
+ virtual int32_t getDefaultMonthInYear(int32_t eyear);
/***
* Called by computeJulianDay. Returns the default day (1-based) for the month,
* taking currently-set year and era into account. Will return the first day of the given
* era, if the current month is an ascension year and month.
+ * @param eyear the extended year
+ * @param mon the month in the year
* @internal
*/
- virtual int32_t getDefaultDayInMonth(int32_t month);
+ virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
};
U_NAMESPACE_END