mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
ICU's Islamic calendar implementations always set ERA=0, even for dates before the Hijra (622 CE), using negative year values instead. However, the CLDR defines two eras: "Anno Hegirae" (era 0) and "Before Hijrah" (era 1). ECMA-402 expects distinct era names in formatToParts output. Similarly, ICU's Coptic calendar has an empty CLDR era 0 name, causing the era parts to be omitted entirely from formatted output. This patch adds another icu::Calendar subclass to handle these cases.
23 lines
547 B
C++
23 lines
547 B
C++
/*
|
|
* Copyright (c) 2026, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
|
|
namespace Unicode {
|
|
|
|
// https://github.com/unicode-org/icu/blob/main/icu4c/source/i18n/gregoimp.h#L127
|
|
constexpr inline i64 EPOCH_START_AS_JULIAN_DAY = 2440588;
|
|
|
|
// https://en.wikipedia.org/wiki/Chinese_calendar_correspondence_table
|
|
constexpr inline i32 CHINESE_CALENDAR_FIRST_YEAR = -2637;
|
|
|
|
// https://en.wikipedia.org/wiki/Dangun_calendar
|
|
constexpr inline i32 DANGI_CALENDAR_FIRST_YEAR = -2333;
|
|
|
|
}
|