Ceske svatky v gcalu

Martin `MJ' Mares mj na ucw.cz
Sobota Září 13 15:51:32 CEST 2003


Hello, world!\n

Hral jsem si dnes chvili s programem gcal a i kdyz je to program velmi
propracovany (nekdy mam dojem, ze az prilis), jeho sada ceskych svatku
pokulhava za realitou o peknych par let. I rekl jsem si, ze napisi patch,
ktery vec uvede na pravou miru (viz nize) a nauci gcal nejen aktualni
sadu svatku, ale i vselijake predchozi verze (kdyz jsem zjistil, kolik
jich bylo, zacal jsem si myslet, ze hlavni pracovni naplni naseho mileho
parlamentu je novelizovat zakon o statnich svatcich :) ). Jenze zatim
jsem se nebyl schopen dopatrat stavu pred rokem 1975 -- nevite, kde by
se o tom dalo neco sehnat (nejlepe samozrejme online)?

				Have a nice fortnight
-- 
Martin `MJ' Mares   <mj na ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Mr. Worf, scan that ship."  "Aye, Captain... 300 DPI?



--- hd-data2.c.mj	Sat Sep 13 13:52:28 2003
+++ hd-data2.c	Sat Sep 13 15:22:17 2003
@@ -3843,50 +3843,87 @@
 {
    register int  day;
 
-
    ptr_cc_id = "CZ";
-   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);
    if (*init_data)
      *init_data = FALSE;
-   holiday (*init_data, detected, _(hd_text[HD_BOXING_DAY].ht_text),
-            ptr_cc_id, "#", 26, MONTH_MAX, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_CHRISTMAS_DAY].ht_text),
-            ptr_cc_id, "+", 25, MONTH_MAX, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_CHRISTMAS_EVE].ht_text),
-            ptr_cc_id, "+", 24, MONTH_MAX, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_DAY_OF_STUDENTS_REVOLT].ht_text),
-            ptr_cc_id, DIS_HLS_PREF, 17, 11, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_EASTER_MONDAY].ht_text),
-            ptr_cc_id, "+", easter+1, 0, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_EASTER_SUNDAY].ht_text),
-            ptr_cc_id, "+", easter, 0, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_KONSTANTIN_AND_METHODIUS].ht_text),
-            ptr_cc_id, "+", 5, 7, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_LABOUR_DAY].ht_text),
-            ptr_cc_id, "#", DAY_MIN, 5, year, hd_elems, fday, count);
+
+   /*
+    * Several important days which are not state holidays.
+    */
    day = eval_holiday (DAY_MIN, 5, year, DAY_MAX, TRUE) + DAY_MAX;
    holiday (*init_data, detected, _(hd_text[HD_MOTHERS_DAY].ht_text),
             ptr_cc_id, DIS_HLS_PREF, day, 5, year, hd_elems, fday, count);
-   holiday (*init_data, detected, _(hd_text[HD_NEW_YEARS_DAY].ht_text),
-            ptr_cc_id, "+", DAY_MIN, MONTH_MIN, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_PEOPLES_UPRISING_DAY].ht_text),
+            ptr_cc_id, DIS_HLS_PREF, 5, 5, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_ALL_SAINTS_DAY].ht_text),
+            ptr_cc_id, DIS_HLS_PREF, 1, 11, year, hd_elems, fday, count);
    holiday (*init_data, detected, _(hd_text[HD_ST_NICHOLAS_DAY].ht_text),
-            ptr_cc_id, DIS_HLS_PREF, 6, MONTH_MAX, year, hd_elems, fday, count);
+            ptr_cc_id, DIS_HLS_PREF, 6, 12, year, hd_elems, fday, count);
    holiday (*init_data, detected, _(hd_text[HD_SYLVESTER].ht_text), ptr_cc_id,
             DIS_HLS_PREF, dvec[MONTH_MAX-1], MONTH_MAX, year, hd_elems, fday, count);
-   if (year > 1414)
-     holiday (*init_data, detected, _(hd_text[HD_BURNING_OF_JAN_HUS].ht_text),
-              ptr_cc_id, "+", 6, 7, year, hd_elems, fday, count);
-   if (year > 1917)
+
+   /*
+    * I've tried to capture the somewhat complex evolution of the Czech holidays,
+    * but so far I have only a little information on the state before year 1975,
+    * so if you know more, please let me know.
+    *				Martin Mares <mj na ucw.cz>, September 2003
+    *
+    * This is a brief sketch of the history:
+    *
+    * Law:		56/75	141/88	167/90	204/90	218/91	245/00
+    * Effective:	23.6.75	21.9.88	10.5.90	18.5.90	31.5.91	9.8.00
+    *  1. 1.		+	+	+	+	+	+
+    *  Easter		+	+	+	+	+	+
+    *  1. 5.		+	+	+	+	+	+
+    *  5. 5.				
+    *  8. 5.						+	+
+    *  9. 5.		+	+	+	+
+    *  5. 7.				+	+	+	+
+    *  6. 7.					+	+	+
+    * 28. 9.							+
+    * 28.10.			+	+	+	+	+
+    * 17.11.							+
+    * 24.12.				+	+	+	+
+    * 25.12.		+	+	+	+	+	+
+    * 26.12.		+	+	+	+	+	+
+    */
+   holiday (*init_data, detected, _(hd_text[HD_NEW_YEARS_DAY].ht_text),
+            ptr_cc_id, "+", 1, 1, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_EASTER_MONDAY].ht_text),
+            ptr_cc_id, "+", easter+1, 0, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_EASTER_SUNDAY].ht_text),
+            ptr_cc_id, "+", easter, 0, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_LABOUR_DAY].ht_text),
+            ptr_cc_id, "+", 1, 5, year, hd_elems, fday, count);
+   if (year >= 1992)
+     holiday (*init_data, detected, _(hd_text[HD_LIBERATION_DAY].ht_text),
+              ptr_cc_id, "+", 8, 5, year, hd_elems, fday, count);
+   else
+     holiday (*init_data, detected, _(hd_text[HD_LIBERATION_DAY].ht_text),
+              ptr_cc_id, "+", 9, 5, year, hd_elems, fday, count);
+   if (year >= 1990)
+     {
+       holiday (*init_data, detected, _(hd_text[HD_KONSTANTIN_AND_METHODIUS].ht_text),
+                ptr_cc_id, "+", 5, 7, year, hd_elems, fday, count);
+       holiday (*init_data, detected, _(hd_text[HD_BURNING_OF_JAN_HUS].ht_text),
+                ptr_cc_id, "+", 6, 7, year, hd_elems, fday, count);
+     }
+   if (year >= 2000)
+     holiday (*init_data, detected, _(hd_text[HD_DAY_OF_CZECH_STATEHOOD].ht_text),
+              ptr_cc_id, "+", 28, 9, year, hd_elems, fday, count);
+   if (year >= 1988)
      holiday (*init_data, detected, _(hd_text[HD_INDEPENDENCE_DAY].ht_text),
               ptr_cc_id, "+", 28, 10, year, hd_elems, fday, count);
-   if (year > 1944)
-    {
-      holiday (*init_data, detected, _(hd_text[HD_PEOPLES_UPRISING_DAY].ht_text),
-               ptr_cc_id, DIS_HLS_PREF, 5, 5, year, hd_elems, fday, count);
-      holiday (*init_data, detected, _(hd_text[HD_LIBERATION_DAY].ht_text),
-               ptr_cc_id, "#", 8, 5, year, hd_elems, fday, count);
-    }
+   if (year >= 2000)
+     holiday (*init_data, detected, _(hd_text[HD_DAY_OF_STUDENTS_REVOLT].ht_text),
+              ptr_cc_id, "+", 17, 11, year, hd_elems, fday, count);
+   if (year >= 1990)
+     holiday (*init_data, detected, _(hd_text[HD_CHRISTMAS_EVE].ht_text),
+              ptr_cc_id, "+", 24, 12, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_CHRISTMAS_DAY].ht_text),
+            ptr_cc_id, "+", 25, 12, year, hd_elems, fday, count);
+   holiday (*init_data, detected, _(hd_text[HD_BOXING_DAY].ht_text),
+            ptr_cc_id, "+", 26, 12, year, hd_elems, fday, count);
 }
 
 
--- hd-defs.h.mj	Sat Sep 13 14:38:05 2003
+++ hd-defs.h	Sat Sep 13 14:38:02 2003
@@ -662,6 +662,7 @@
 #    define  HD_WHITSUN_EVE                        548
 #    define  HD_W_TUBMANS_BIRTHDAY                 549
 #    define  HD_YAP_DAY                            550
+#    define  HD_DAY_OF_CZECH_STATEHOOD             551
 #  endif /* !HD_TOP20CC */
 
 
--- hd-data.c.mj	Sat Sep 13 14:35:51 2003
+++ hd-data.c	Sat Sep 13 14:44:55 2003
@@ -1382,7 +1382,8 @@
   { HD_WEST_VIRGINIA_DAY,                 "West-Virginia-Tag" },
   { HD_WHITSUN_EVE,                       "Pfingstvorabend" },
   { HD_W_TUBMANS_BIRTHDAY,                "W. Tubmans Geburtstag" },
-  { HD_YAP_DAY,                           "Yap-Tag" }
+  { HD_YAP_DAY,                           "Yap-Tag" },
+  { HD_DAY_OF_CZECH_STATEHOOD,            "Tag der Tschechische Staatlichkeit" }
 #  endif /* !HD_TOP20CC */
 #else /* !USE_DE */
   /*
@@ -1948,7 +1949,8 @@
   { HD_WEST_VIRGINIA_DAY,                 N_("West Virginia Day") },
   { HD_WHITSUN_EVE,                       N_("Whitsun Eve") },
   { HD_W_TUBMANS_BIRTHDAY,                N_("W. Tubman's Birthday") },
-  { HD_YAP_DAY,                           N_("Yap Day") }
+  { HD_YAP_DAY,                           N_("Yap Day") },
+  { HD_DAY_OF_CZECH_STATEHOOD,            N_("Day of Czech Statehood") }
 #  endif /* !HD_TOP20CC */
 #endif /* !USE_DE */
 };


Další informace o konferenci Linux