1 of 15

era and year in ICU calendars

Frank Yung-Fong Tang

ftang@google.com

2022-09-06

2 of 15

Calendar

GregorianCalendar

(“gregorian” / “gregory”)

Public Headers

Private Headers / Internal

TaiwanCalendar

(“roc”)

JapaneseCalendar

(“japanese”)

BuddhistCalendar

(“buddhist”)

PersianCalendar

(“persian”)

IndianCalendar

(“indian”)

IslamicCalendar

HebrewCalendar

(“hebrew”)

CECalendar

CopticCalendar

(“coptic”)

EthiopicCalendar

ChineseCalendar

(“chinese”)

DangiCalendar

(“dangi”)

Interface

Abstract Class

Concrete Class

(“key” / key in JS)

Extended Class Diagram of Calendar Classes inside ICU

(“ethiopic”)

(“ethiopic-amete-alem” / “ethioaa”)

(“key”)

Typed objects:

(“islamic”)

(“islamic-civil”)

(“islamic-umalqura”)

(“islamic-tbla”)

(“islamic-rgsa”)

(“iso8601”)

3 of 15

Five Different Models for year and era

I

II

IV

-2 -1 0 1 2

3 2 1 1 2

-2 -1 0 1 2

1 2

1 2

1 2

1 2

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

V

III

-2 -1 0 1 2 5499 5500 1 2

4 of 15

Five Different Models for year and era

-2 -1 0 1 2

3 2 1 1 2

-2 -1 0 1 2

1 2

1 2

1 2

1 2

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

One Directional Line (e.g. “iso8601”, “buddhist”, “hebrew”, “islamic”, "ethiopic-amete-alem”, etc)

Irregular Length Directional Lines (e.g. “japanese”)

Two Directional Lines Opposite Direction (e.g. “gregory”, “roc”, “copic”,)

Fixed Length Directional Lines (e.g. “chinese”, “dangi”)

Two Directional Lines Same Direction ("ethiopic")

-2 -1 0 1 2 5499 5500 1 2

I

II

IV

V

III

5 of 15

Calendars in ICU 71.1

  • “iso8601”
  • “persian”
  • “indian”
  • “hebrew”
  • “islamic”
  • “islamic-tbla”
  • “islamic-civil”
  • “islamic-umalqura”
  • “islamic-rgsa”
  • “ethiopic-amete-alem”
  • “buddhist”
  • “ethiopic”
  • “gregory”
  • “coptic”
  • “roc”
  • “japanese”
  • “chinese”
  • “dangi”

I

II

III

IV

V

6 of 15

Type I - One Directional Line

-2 -1 0 1 2

Calendars in ICU:

  • “iso8601”
  • “persian”
  • “indian”
  • “hebrew”
  • “islamic”
  • “islamic-tbla”
  • “islamic-civil”
  • “islamic-umalqura”
  • “islamic-rgsa”
  • "ethiopic-amete-alem”
  • “buddhist”

Since there is only one era, there are no need to specify “era”

I

7 of 15

Type II - Two Directional Lines Opposite Direction

3 2 1 1 2 1970 2022

Calendars in ICU:

  • “gregory”: BC and AD
  • “coptic”: BCE and CE
  • “roc”: BEFORE_MINGUO and MINGUO
    • Shift 1912 years

Should we define one single set of two values for all of them?

  • “beforeCurrentEra” and “currentEra”

gregory: BC AD

3 2 1 1 2 110

roc: Before MinGuo MinGuo

3 2 1 1 2 1970 2022

coptic: BCE (Before Coptic Era) CE (Coptic Era)

3 2 1 1 2 1739

II

8 of 15

Type III - Two Directional Lines Same Direction

Amete Alem Amete Mihret

-2 -1 0 1 2 5499 5500 1 2 2014

Calendars in ICU:

  • "ethiopic”
    • AMETE_ALEM and AMETE_MIHRET

It could be viewed as a special case of Type IV

III

"ethiopic”

9 of 15

Side Note: “ethiopic” vs "ethiopic-amete-alem” calendar

Amete Alem Amete Mihret

-2 -1 0 1 2 5499 5500 1 2 2014

III

"ethiopic”

-2 -1 0 1 2 5499 5500 5501 7514

I

Amete Alem

"ethiopic-amete-alem”

  • Amete Alem (ዓመተ ዓለም) = “The year of the world”
  • Amete Mihret (ዓመተ ምሕረት) = “The year of mercy”

Ref https://ethiopiancalendar.wordpress.com/history/

10 of 15

Type IV - Irregular Length Directional Lines

-2 -1 0 1 2

1 2

1 2

1 2

1 2

Calendars in ICU:

  • "japanese”
    • One (or more) for each Japanese Emperor Ruling Period
    • Length is irregular and unpredictable for the future

IV

11 of 15

Type V - Fixed Length Directional Lines

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

Calendars in ICU:

  • “chinese”:
  • “dangi”

It is really not a true era/eraYear in the calendar, but rather a hacky way to put 60 years cycle (0..59) with a cycle sequence into year and era fields.

era = extended_year / 60 => cycle sequence

year = exteneded_year % 60 => year in the cycle

People know the “year in the cycle” in the culture

No people know about the cycle sequence

V

12 of 15

Five Different Models for year and era

I

II

IV

-2 -1 0 1 2

3 2 1 1 2

-2 -1 0 1 2

1 2

1 2

1 2

1 2

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

0 1 …. 59

V

III

-2 -1 0 1 2 5499 5500 1 2

13 of 15

Calendars in ICU 71.1

  • “iso8601”
  • “persian”
  • “indian”
  • “hebrew”
  • “islamic”
  • “islamic-tbla”
  • “islamic-civil”
  • “islamic-umalqura”
  • “islamic-rgsa”
  • "ethiopic-amete-alem”
  • “buddhist”
  • “ethiopic”
  • “gregory”
  • “coptic”
  • “roc”
  • “japanese”
  • “chinese”
  • “dangi”

I

II

III

IV

V

14 of 15

Proposal to ECMA402 Intl-Temporal

  • Type I: Do NOT use era and eraYear (return both as undefined)
  • Type II (“gregory”, “coptic”, “roc”) : Two possible approaches
    • Approach A: Define one single set of two values
      • “currentEra” and “beforeCurrentEra” (could be other strings)
      • Can NOT be “commonEra” “CE” or “beforeCommonEra” �“BCE”
    • Approach B: Define one set of two string for each calendar
  • Type III: (“ethiopic”): TBD
  • Type IV: (“japanese”): TBD
  • Type V: Not supporting the “year in cycle” + “cycle sequence”
    • Treat “year in cycle” + 60 * “cycle sequence” as Type I.

15 of 15

In ICU4X

“gregory” era:

  • “bce”
  • “ce”

“japanese” era:

  • “bce”
  • “ce”
  • "meiji"
  • "taisho"
  • "showa"
  • "heisei"
  • "reiwa"

“buddhist” era

  • “be”

“indian” era:

  • “saka”

“coptic” era:

  • “bd”
  • “ad”

“ethopic” era:

  • “mundi”
  • “pre-incar”
  • “incar”

Why do we need to pass in an era code which can only be one value and return error if not?

Different semantic than ICU (see Type III)