From 15f0ed6cf7860a272e8473885ff4691c1e169c44 Mon Sep 17 00:00:00 2001 From: osa Date: Sat, 12 Mar 2011 14:57:10 +0000 Subject: [PATCH] MFC r216697: Fix typo (Pashka -> Paskha). MFC r217025: Fix typo: March -> September. MFC r218471: Fix Paskha and Paskha-specific holidays. MFC r218473: Always convert Paskha day from Julian (old) to Gregorian (new) style by adding 13 days. Bug introduced in 1.13 revision. MFC r218771: Fix the beginning day of the Great Lent, it starts on Monday for 7 weeks before Paskha. Fix the Exaltation of the Holy Cross day. Add more Twelve holidays (dvunadesyatye prazdniki). MFC r218797: Replace hard-coded value by Julian2Gregorian converter function. MFC r219174: Fix beginning day of the Carnival. MFC r219175: Expand the name of Palm Sunday holiday with more canonical Entry of the Lord into Jerusalem. Merge the Pentecost and Trinity Sunday holidays, they are synonyms. Remove Body of Christ day, nonexistent holiday for Orthodox Church. Fix typo in the name of Ioann The Baptist, introduced in previous commit. git-svn-id: svn://svn.freebsd.org/base/stable/8@219569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/calendar/calendar.1 | 4 ++-- usr.bin/calendar/calendar.h | 3 ++- .../calendars/ru_RU.KOI8-R/calendar.orthodox | 14 ++++++++------ .../calendar/calendars/ru_RU.KOI8-R/calendar.pagan | 2 +- usr.bin/calendar/parsedata.c | 3 ++- usr.bin/calendar/paskha.c | 13 +++++++++++-- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/usr.bin/calendar/calendar.1 b/usr.bin/calendar/calendar.1 index f251b7624..42fa68dd7 100644 --- a/usr.bin/calendar/calendar.1 +++ b/usr.bin/calendar/calendar.1 @@ -128,7 +128,7 @@ The solar equinox in March. .It JunSolstice The solar solstice in June. .It SepEquinox -The solar equinox in March. +The solar equinox in September. .It DecSolstice The solar solstice in December. .It ChineseNewYear @@ -155,7 +155,7 @@ The names of the recognized special days may be followed by a positive or negative integer, like: .Dq Easter+3 or -.Dq Pashka-4 . +.Dq Paskha-4 . .Pp Weekdays may be followed by ``-4'' ...\& ``+5'' (aliases for last, first, second, third, fourth) for moving events like diff --git a/usr.bin/calendar/calendar.h b/usr.bin/calendar/calendar.h index 8166baea4..a4903b1a1 100644 --- a/usr.bin/calendar/calendar.h +++ b/usr.bin/calendar/calendar.h @@ -167,9 +167,10 @@ void cal(void); void closecal(FILE *); FILE *opencal(void); -/* ostern.c / pashka.c */ +/* ostern.c / paskha.c */ int paskha(int); int easter(int); +int j2g(int); /* dates.c */ extern int cumdaytab[][14]; diff --git a/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox b/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox index ac38458d4..83d1710ae 100644 --- a/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox +++ b/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox @@ -11,24 +11,26 @@ LANG=ru_RU.KOI8-R Paskha=ðÁÓÈÁ 21 ÓÅÎ òÏÖÄÅÓÔ×Ï ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ -28 ÓÅÎ ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ +27 ÓÅÎ ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ 14 ÏËÔ ðÏËÒÏ× ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ 4 ÄÅË ÷×ÅÄÅÎÉÅ ×Ï ÈÒÁÍ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ 7 ÑÎ× òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï +14 ÑÎ× ïÂÒÅÚÁÎÉÅ çÏÓÐÏÄÎÅ 19 ÑÎ× âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ 15 ÆÅ× óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ -ðÁÓÈÁ-46 ÷ÅÌÉËÉÊ ðÏÓÔ -ðÁÓÈÁ-7 ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ +ðÁÓÈÁ-48 ÷ÅÌÉËÉÊ ðÏÓÔ +ðÁÓÈÁ-7 ÷ÈÏÄ çÏÓÐÏÄÅÎØ × éÅÒÕÓÁÌÉÍ. ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ ðÁÓÈÁ-3 ÷ÅÌÉËÉÊ þÅÔ×ÅÒÇ ðÁÓÈÁ-2 óÔÒÁÓÔÎÁÑ ðÑÔÎÉÃÁ ðÁÓÈÁ ÷ÏÓËÒÅÓÅÎÉÅ èÒÉÓÔÏ×Ï ðÁÓÈÁ+39 ÷ÏÚÎÅÓÅÎÉÅ -ðÁÓÈÁ+49 ðÑÔÉÄÅÓÑÔÎÉÃÁ -ðÁÓÈÁ+56 ôÒÏÉÃÉÎ äÅÎØ -ðÁÓÈÁ+60 ðÒÁÚÄÎÉË ôÅÌÁ èÒÉÓÔÏ×Á +ðÁÓÈÁ+49 äÅÎØ ó×ÑÔÏÊ ôÒÏÉÃÙ. ðÑÔÉÄÅÓÑÔÎÉÃÁ 7 ÁÐÒ âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ + 7 ÉÀÌ òÏÖÄÅÓÔ×Ï éÏÁÎÎÁ ðÒÅÄÔÅÞÉ +12 ÉÀÌ äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ 19 Á×Ç ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ 28 Á×Ç õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ +11 ÓÅÎ õÓÅËÎÏ×ÅÎÉÅ ÇÌÁ×Ù éÏÁÎÎÁ ðÒÅÄÔÅÞÉ #endif /* !_ru_RU_KOI8_R_orthodox_ */ diff --git a/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan b/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan index 2fb6bc072..f2fc4e035 100644 --- a/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan +++ b/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan @@ -17,7 +17,7 @@ Paskha= 29 ÆÅ× äÅÎØ ëÁÝÅÑ 1 ÍÁÒ äÅÎØ íÁÒÅÎÙ 14 ÍÁÒ îÏ×ÙÊ çÏÄ, ï×ÓÅÎØ ÍÁÌÙÊ -ðÁÓÈÁ-47 íÁÓÌÅÎÉÃÁ +ðÁÓÈÁ-55 íÁÓÌÅÎÉÃÁ ðÁÓÈÁ+7 ëÒÁÓÎÁÑ çÏÒËÁ ðÁÓÈÁ+16 òÁÄÕÎÉÃÁ 20 ÍÁÒ* ÷ÅÓÅÎÎÉÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ diff --git a/usr.bin/calendar/parsedata.c b/usr.bin/calendar/parsedata.c index 51834390d..7cd7d017d 100644 --- a/usr.bin/calendar/parsedata.c +++ b/usr.bin/calendar/parsedata.c @@ -80,7 +80,7 @@ static char *floattotime(double f); * ModifierIndex ::= 'Second' | 'Third' | 'Fourth' | 'Fifth' | * 'First' | 'Last' * - * SpecialDay ::= 'Easter' | 'Pashka' | 'ChineseNewYear' + * SpecialDay ::= 'Easter' | 'Paskha' | 'ChineseNewYear' * */ static int @@ -459,6 +459,7 @@ parsedaymonth(char *date, int *yearp, int *monthp, int *dayp, int *flags, yearinfo->mondays = mondaytab[isleap(year)]; yearinfo->ieaster = easter(year); + yearinfo->ipaskha = paskha(year); fpom(year, UTCOffset, yearinfo->ffullmoon, yearinfo->fnewmoon); fpom(year, UTCOFFSET_CNY, yearinfo->ffullmooncny, diff --git a/usr.bin/calendar/paskha.c b/usr.bin/calendar/paskha.c index 373ee5d26..ab369ad23 100644 --- a/usr.bin/calendar/paskha.c +++ b/usr.bin/calendar/paskha.c @@ -36,8 +36,17 @@ __FBSDID("$FreeBSD$"); #define PASKHA "paskha" #define PASKHALEN (sizeof(PASKHA) - 1) +/* return difference in days between Julian and Gregorian calendars */ +int +j2g(int year) +{ + return (year < 1500) ? + 0 : + 10 + (year/100 - 16) - ((year/100 - 16) / 4); +} + /* return year day for Orthodox Easter using Gauss formula */ -/* (old style result) */ +/* (new style result) */ int paskha(int R) /*year*/ @@ -53,5 +62,5 @@ paskha(int R) /*year*/ d = (19 * a + x) % 30; e = (2 * b + 4 * c + 6 * d + y) % 7; cumday = cumdaytab[isleap(R)]; - return (((cumday[3] + 1) + 22) + (d + e)); + return (((cumday[3] + 1) + 22) + (d + e) + j2g(R)); } -- 2.45.0