When I use "cal" on Red Hat Linux 7.2 (with LC_ALL=sv_SE), I get: november 2001 sv me ti on to fr lv 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 In other words, Sunday is shown as the first day of the week. This is wrong for the Swedish locale, where the first day of week should be Monday. If I use "cal -m" I get the correct behavior, but it is troublesome that cal doesn't automatically adopt to the locale. The first day of week information is easily fetchable on glibc 2.2 systems by querying the _NL_TIME_FIRST_WEEKDAY variable with nl_langinfo(), or from the commandline with "locale first_weekday". It would be great if cal could be extended to use this information (if present) by default.
This is probably something that the util-linux maintainer should handle directly. Please contact util-linux.no with this request, and then we will pull the fixes from upstream.
Looking at the latest version of util-linux, you find that the following trivial patch will fix this. However, you can also clearly see why it's not fixed :) --- util-linux-2.11m/misc-utils/cal.c Mon Sep 3 01:45:24 2001 +++ util-linux-2.11m/misc-utils/cal.c.new Tue Nov 20 14:14:11 2001 @@ -199,10 +199,8 @@ bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); -#if 0 /* setting week1stday is against man page */ #ifdef HAVE_langinfo_h week1stday = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0]; -#endif #endif yflag = 0;
Mail sent to util-linux.no.
Also see bug #56657