--- gtk/gtkcalendar.c
+++ gtk/gtkcalendar.c
@@ -29,6 +29,9 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+/* for strptime() */
+#define _XOPEN_SOURCE
+
 #include <config.h>
 
 #ifdef HAVE_SYS_TIME_H
@@ -704,12 +707,39 @@
   first_weekday = langinfo[0];
   langinfo = nl_langinfo (_NL_TIME_WEEK_1STDAY);
   week_origin = GPOINTER_TO_INT (langinfo);
-  if (week_origin == 19971130) /* Sunday */
-    week_1stday = 0;
-  else if (week_origin == 19971201) /* Monday */
-    week_1stday = 1;
-  else
-    g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
+  switch (week_origin) {
+    case 19971130: /* Sunday */
+      week_1stday = 0;
+      break;
+    case 19971201: /* Monday */
+    case 19971202:
+    case 19971203:
+    case 19971204:
+    case 19971205:
+    case 19971206: /* Saturday */
+      week_1stday = week_origin - 19971200;
+      break;
+    default: {
+      /* glibc's localedef doesn't normalize week-1stday, so we can get
+       * fi. 19971208 meaning the same as 19971201, etc. */
+#ifdef _XOPEN_SOURCE
+      char buf[9];
+      char *ptr;
+      struct tm tm;
+      g_snprintf(buf, sizeof(buf), "%u", week_origin);
+      ptr = strptime(buf, "%Y%m%d", &tm);
+      if (!ptr || *ptr != '\0') {
+        g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
+        week_1stday = 0;
+        break;
+      }
+      week_1stday = tm.tm_wday;
+#else
+      g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
+      week_1stday = 0;
+#endif
+    }
+  }
 
   priv->week_start = (week_1stday + first_weekday - 1) % 7;
 #else
