Bug#257800: patch

TB TB <40618.nospam@comcast.net>, 257800@bugs.debian.org
Tue, 6 Jul 2004 00:33:54 -0700


The bug is that gtkcalendar needs to add +1 to the month in the call to 
g_date_new_dmy.  I just noticed all the months are off by 1, if you drag 
"July 30, 2004" to something it outputs 6/30/2004.  So dragging any date 
in January produces the invalid date warning; or any date whose previous 
month doesn't go that high.  But as I say all the dragged dates are off 
by 1 month.

See more at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=257800


$ diff -u gtkcalendar.c.orig gtkcalendar.c
--- gtkcalendar.c.orig  2004-07-06 00:28:26.000000000 -0700
+++ gtkcalendar.c       2004-07-06 00:28:39.000000000 -0700
@@ -3371,7 +3371,7 @@
   gchar str[128];
   gsize len;

-  date = g_date_new_dmy (calendar->selected_day, calendar->month, calendar->year);
+  date = g_date_new_dmy (calendar->selected_day, calendar->month + 1, calendar->year);
   len = g_date_strftime (str, 127, "%x", date);
   gtk_selection_data_set_text (selection_data, str, len);