bug-gcal
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gcal] gcal-3.6: fixes for german federal state holidays


From: Friedrich Haubensak
Subject: [Bug-gcal] gcal-3.6: fixes for german federal state holidays
Date: Thu, 11 Nov 2010 12:32:08 +0100 (MET)

gcal has provisions to display german holidays different by federal state

the code is in src/hd-data3.c, but it does not work correctly (e.g.,
corpus-christi not shown for baden-wuerttemberg)

for release gcal-3.6, i prepared the following patch to hd-data3.c to
make it work (delete several calls of de_hdy(), insert some missing
statements w.r.t the use of the use_other_cc toggle, delete some
redundant calls of holiday() )
and futhermore to fix some errors and omissions regarding holidays


--- src/hd-data3.c__dist        Wed Jun 02 15:31:48 MDT 2010
+++ src/hd-data3.c      Thu Nov 11 09:59:33 MET 2010
@@ -68,13 +68,19 @@
    Manages all specific holidays celebrated in Germany/Bavaria.
 */
 {
+  register int day;
+
   ptr_cc_id = "DE_BY";
   use_other_cc = !use_other_cc;
-  de_nw_hdy (init_data, detected, easter, year, hd_elems, fday, count);
+  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
           ptr_cc_id, "+", DAY_MIN, 11, year, hd_elems, fday, count);
+  holiday (*init_data, detected, _(hd_text[HD_ALL_SOULS_DAY].ht_text),
+          ptr_cc_id, DIS_HLS_PREF, 2, 11, year, hd_elems, fday, count);
+  holiday (*init_data, detected,
+          _(hd_text[HD_FEAST_OF_CORPUS_CHRISTI].ht_text), ptr_cc_id, "+",
+          easter + 60, 0, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_MARYS_ASCENSION_DAY].ht_text),
           ptr_cc_id, "#", 15, 8, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_THREE_KINGS_DAY].ht_text),
@@ -81,6 +87,14 @@
           ptr_cc_id, "+", 6, MONTH_MIN, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_PEACE_FESTIVAL].ht_text),
           ptr_cc_id, DIS_HLS_PREF2, 8, 8, year, hd_elems, fday, count);
+  if ( year > 1951 ) {
+    day = weekday_of_date (DAY_MIN, 11, year);
+    day = (day < 3) ? 18 - day : 25 - day;
+    holiday (*init_data, detected,
+            _(hd_text[HD_DAY_OF_PRAYER_AND_REPENTANCE].ht_text), ptr_cc_id,
+            (year < 1981) ? DIS_HLS_PREF2 : ((year > 1994) ? DIS_HLS_PREF : 
"+"),
+            day, 11, year, hd_elems, fday, count);
+  }
 }
 
 
@@ -98,6 +112,8 @@
    Manages all specific holidays celebrated in Germany/Brandenburg.
 */
 {
+  register int day;
+
   if (!use_other_cc)
     {
       ptr_cc_id = "DE_BB";
@@ -113,6 +129,14 @@
   if (year > 1989)
     holiday (*init_data, detected, _(hd_text[HD_GERMAN_UNITY_DAY].ht_text),
             ptr_cc_id, "+", 3, 10, year, hd_elems, fday, count);
+  if (year < 1966 || year > 1989) {
+    day = weekday_of_date (DAY_MIN, 11, year);
+    day = (day < 3) ? 18 - day : 25 - day;
+    holiday (*init_data, detected,
+          _(hd_text[HD_DAY_OF_PRAYER_AND_REPENTANCE].ht_text), ptr_cc_id,
+          (year > 1994) ? DIS_HLS_PREF : "+", day, 11, year, hd_elems, fday,
+          count);
+  }
 }
 
 
@@ -136,8 +160,12 @@
   if (!use_other_cc)
     {
       ptr_cc_id = "DE_BE";
+      use_other_cc = !use_other_cc;
       de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
+      use_other_cc = !use_other_cc;
     }
+  else
+    de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   day = weekday_of_date (DAY_MIN, 11, year);
   day = (day < 3) ? 18 - day : 25 - day;
   holiday (*init_data, detected,
@@ -165,7 +193,6 @@
   use_other_cc = !use_other_cc;
   de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
 }
 
 
@@ -187,9 +214,6 @@
   use_other_cc = !use_other_cc;
   de_nw_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
-  holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
-          ptr_cc_id, "+", DAY_MIN, 11, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_THREE_KINGS_DAY].ht_text),
           ptr_cc_id, "+", 6, MONTH_MIN, year, hd_elems, fday, count);
 }
@@ -213,7 +237,6 @@
   use_other_cc = !use_other_cc;
   de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
 }
 
 
@@ -235,7 +258,6 @@
   use_other_cc = !use_other_cc;
   de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   holiday (*init_data, detected,
           _(hd_text[HD_FEAST_OF_CORPUS_CHRISTI].ht_text), ptr_cc_id, "+",
           easter + 60, 0, year, hd_elems, fday, count);
@@ -281,7 +303,6 @@
   use_other_cc = !use_other_cc;
   de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
 }
 
 
@@ -305,8 +326,9 @@
       use_other_cc = !use_other_cc;
       de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
       use_other_cc = !use_other_cc;
-      de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
     }
+  else
+    de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
           ptr_cc_id, "+", DAY_MIN, 11, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_ALL_SOULS_DAY].ht_text),
@@ -335,9 +357,6 @@
   use_other_cc = !use_other_cc;
   de_nw_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
-  holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
-          ptr_cc_id, "+", DAY_MIN, 11, year, hd_elems, fday, count);
 }
 
 
@@ -382,7 +401,6 @@
   use_other_cc = !use_other_cc;
   de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
 }
 
 
@@ -402,13 +420,8 @@
 {
   ptr_cc_id = "DE_SL";
   use_other_cc = !use_other_cc;
-  de_be_hdy (init_data, detected, easter, year, hd_elems, fday, count);
+  de_nw_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
-  holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
-          ptr_cc_id, "+", DAY_MIN, 11, year, hd_elems, fday, count);
-  holiday (*init_data, detected, _(hd_text[HD_ALL_SOULS_DAY].ht_text),
-          ptr_cc_id, DIS_HLS_PREF, 2, 11, year, hd_elems, fday, count);
   holiday (*init_data, detected, _(hd_text[HD_MARYS_ASCENSION_DAY].ht_text),
           ptr_cc_id, "+", 15, 8, year, hd_elems, fday, count);
 }
@@ -433,23 +446,22 @@
 
   ptr_cc_id = "DE_SN";
   use_other_cc = !use_other_cc;
-  de_hdy (init_data, detected, easter, year, hd_elems, fday, count);
+  de_bb_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
   holiday (*init_data, detected,
           _(hd_text[HD_FEAST_OF_CORPUS_CHRISTI].ht_text), ptr_cc_id,
           DIS_HLS_PREF2, easter + 60, 0, year, hd_elems, fday, count);
-  day = weekday_of_date (DAY_MIN, 11, year);
-  day = (day < 3) ? 18 - day : 25 - day;
-  holiday (*init_data, detected,
-          _(hd_text[HD_DAY_OF_PRAYER_AND_REPENTANCE].ht_text), ptr_cc_id,
-          "+", day, 11, year, hd_elems, fday, count);
-  if (year > 1516)
-    holiday (*init_data, detected, _(hd_text[HD_REFORMATION_DAY].ht_text),
-            ptr_cc_id, DIS_HLS_PREF2, dvec[10 - 1], 10, year, hd_elems, fday,
-            count);
-  if (year > 1989)
-    holiday (*init_data, detected, _(hd_text[HD_GERMAN_UNITY_DAY].ht_text),
-            ptr_cc_id, "+", 3, 10, year, hd_elems, fday, count);
+  holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
+          ptr_cc_id, DIS_HLS_PREF, DAY_MIN, 11, year, hd_elems, fday, count);
+  holiday (*init_data, detected, _(hd_text[HD_ALL_SOULS_DAY].ht_text),
+          ptr_cc_id, DIS_HLS_PREF, 2, 11, year, hd_elems, fday, count);
+  if (year < 1966 || year > 1989) {
+    day = weekday_of_date (DAY_MIN, 11, year);
+    day = (day < 3) ? 18 - day : 25 - day;
+    holiday (*init_data, detected,
+            _(hd_text[HD_DAY_OF_PRAYER_AND_REPENTANCE].ht_text), ptr_cc_id,
+            "+", day, 11, year, hd_elems, fday, count);
+  }
 }
 
 
@@ -472,7 +484,7 @@
   de_bb_hdy (init_data, detected, easter, year, hd_elems, fday, count);
   use_other_cc = !use_other_cc;
   holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
-          ptr_cc_id, DIS_HLS_PREF2, DAY_MIN, 11, year, hd_elems, fday,
+          ptr_cc_id, DIS_HLS_PREF, DAY_MIN, 11, year, hd_elems, fday,
           count);
   holiday (*init_data, detected, _(hd_text[HD_ALL_SOULS_DAY].ht_text),
           ptr_cc_id, DIS_HLS_PREF, 2, 11, year, hd_elems, fday, count);


-- 
Friedrich Haubensak   address@hidden | Science is true!
   Leibniz Institute for Age Research    |   Don't be mislead by facts.
      - Fritz Lipmann Institute -        +-----------------------------
Beutenbergstrasse 11, D-07745 Jena | Tel. +49-3641-65-6202 | Fax  -6210



reply via email to

[Prev in Thread] Current Thread [Next in Thread]