The operation throws a TypeError exception if the properties of fields are internally inconsistent within the calendar or insufficient to identify a unique instance of type in the calendar. For example:
If "month" and "monthCode" in the calendar have interpretations analogous to ISO 8601 and either the corresponding values for both are undefined or neither value is undefined but they do not identify the same month.
...
If type is date or year-month and [...] the values for "era" and "eraYear" do not together identify the same year as the value for "year".
Questions:
Is it correct to throw a TypeError? The ISO-8601 calendar throws a RangeError when month and monthCode are inconsistent.
Is it possible to check for inconsistent year/eraYear resp. month/monthCode this early? For example to validate that the month code M03 identifies the same month as the ordinal month number 4 in the Chinese calendar, it's first necessary to resolve the complete date (, because leap months can appear after any month, so there can be a leap month M01L or M02L, which makes M03 the fourth month of the year).
CalendarResolveFields has the following two requirements:
Questions:
month
andmonthCode
are inconsistent.M03
identifies the same month as the ordinal month number 4 in the Chinese calendar, it's first necessary to resolve the complete date (, because leap months can appear after any month, so there can be a leap monthM01L
orM02L
, which makesM03
the fourth month of the year).