Kaydet (Commit) 5e67aa92 authored tarafından DaeHyun Sung's avatar DaeHyun Sung Kaydeden (comit) Eike Rathke

Support to Korean Dangi Calendar for tdf#125446

Support to Korean Traditional Calendar, Dan-gi(단기/檀紀) Calendar

The era name, Dangi(단기,檀紀) originating from the foundation of Gojoseon[고조선/古朝鮮] is also widely used in Korea as an indication of long civilization of Korea.

Full name: `Dangun-giwon (단군기원, 檀君紀元 "First Age of Lord Dangun")`

Abbreviation Name: `Dangi(단기,檀紀)`

The Dangi Calendar measures years from the ancient founding of Korea in 2333 B.C.

Reference. ICU Library
ICU library support Dangi Calendar.
ICU4C 50 http://bugs.icu-project.org/trac/ticket/9255
ICU4J 51 http://bugs.icu-project.org/trac/ticket/9616

Change-Id: I490b8b288c68f498eb29d4fcc73251cbef3ac6d4
Reviewed-on: https://gerrit.libreoffice.org/72943
Tested-by: Jenkins
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst ad2acdfa
......@@ -177,6 +177,16 @@ public:
};
// class Calendar_dangi
class Calendar_dangi : public Calendar_gregorian
{
public:
// Constructors
Calendar_dangi();
};
// class Calendar_buddhist
class Calendar_buddhist : public Calendar_gregorian
......
......@@ -226,6 +226,19 @@ Calendar_ROC::Calendar_ROC() : Calendar_gregorian(ROC_eraArray)
cCalendar = "com.sun.star.i18n.Calendar_ROC";
}
/**
* The start year of the Korean traditional calendar (Dan-gi) is the inaugural
* year of Dan-gun (BC 2333).
*/
static const Era dangi_eraArray[] = {
{-2332, 1, 1, 0},
{0, 0, 0, 0}
};
Calendar_dangi::Calendar_dangi() : Calendar_gregorian(dangi_eraArray)
{
cCalendar = "com.sun.star.i18n.Calendar_dangi";
}
static const Era buddhist_eraArray[] = {
{-542, 1, 1, 0},
{0, 0, 0, 0}
......
......@@ -114,6 +114,7 @@ IMPL_CREATEINSTANCE( Calendar_gregorian )
IMPL_CREATEINSTANCE( Calendar_hanja )
IMPL_CREATEINSTANCE( Calendar_gengou )
IMPL_CREATEINSTANCE( Calendar_ROC )
IMPL_CREATEINSTANCE( Calendar_dangi )
IMPL_CREATEINSTANCE( Calendar_hijri )
IMPL_CREATEINSTANCE( Calendar_jewish )
IMPL_CREATEINSTANCE( Calendar_buddhist )
......@@ -295,6 +296,9 @@ static const struct InstancesArray {
{ "com.sun.star.i18n.Calendar_ROC",
"com.sun.star.i18n.Calendar_ROC",
&Calendar_ROC_CreateInstance },
{ "com.sun.star.i18n.Calendar_dangi",
"com.sun.star.i18n.Calendar_dangi",
&Calendar_dangi_CreateInstance },
{ "com.sun.star.i18n.Calendar_hanja_yoil",
"com.sun.star.i18n.Calendar_hanja_yoil",
&Calendar_hanja_CreateInstance },
......
......@@ -49,6 +49,9 @@
<implementation name="com.sun.star.i18n.Calendar_ROC">
<service name="com.sun.star.i18n.Calendar_ROC"/>
</implementation>
<implementation name="com.sun.star.i18n.Calendar_dangi">
<service name="com.sun.star.i18n.Calendar_dangi"/>
</implementation>
<implementation name="com.sun.star.i18n.Calendar_buddhist">
<service name="com.sun.star.i18n.Calendar_buddhist"/>
</implementation>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment