Package: bsdmainutils
Version: 8.2.2
Severity: wishlist
Tags: l10n

A few months ago, I got an angry reply to my feature request for making -M
work for cal. [1]. After looking throug bsdmainutils' bugs, I see the reason.
The issue of the first weekday for cal has been raised more than once and in
different ways.

My understanding is that traditional cal used horizontal layout and ncal
introduced a more efficient vertical layout.

There is another important difference for an occasional user, such as myself:
cal always displays weeks starting with Sunday while ncal displays weeks
starting with the current locale's first weekday, by default. To complicate
the matter, ncal now has the option to use horizontal layout with current
locale's first weekday, unlike cal.

What if we kept only one main distinction between cal and ncal: the layout
and let both use the current locale's first weekday by default?

This breaks the compatibility with earlier versions of ncal, but the
distinction between cal and ncal becomes more clear and the usability of cal
greatly improves.

See the patch in attachment.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590592#30
--- freebsd/usr.bin/ncal/ncal.c	2011-02-22 13:04:51.000000000 +0100
+++ bsdmainutils/usr.bin/ncal/ncal.c	2011-02-22 13:05:37.000000000 +0100
@@ -257,20 +257,17 @@
 
 	/* Determine on what day the week starts. */
 #ifdef __GLIBC__
-	if (!flag_backward) 
-	{
-		int first_week_i;
-		date first_week_d;
-		date sunday = { .y = 1997, .m = 11, .d = 30 };
+	int first_week_i;
+	date first_week_d;
+	date sunday = { .y = 1997, .m = 11, .d = 30 };
 
-		first_week_i = (intptr_t) nl_langinfo(_NL_TIME_WEEK_1STDAY);
-		first_week_d.d = first_week_i % 100;
-		first_week_i /= 100;
-		first_week_d.m = first_week_i % 100;
-		first_week_i /= 100;
-		first_week_d.y = first_week_i;
-		weekstart = *nl_langinfo(_NL_TIME_FIRST_WEEKDAY) + (ndaysj(&first_week_d) - ndaysj(&sunday)) % 7 - 1;
-	}
+	first_week_i = (intptr_t) nl_langinfo(_NL_TIME_WEEK_1STDAY);
+	first_week_d.d = first_week_i % 100;
+	first_week_i /= 100;
+	first_week_d.m = first_week_i % 100;
+	first_week_i /= 100;
+	first_week_d.y = first_week_i;
+	weekstart = *nl_langinfo(_NL_TIME_FIRST_WEEKDAY) + (ndaysj(&first_week_d) - ndaysj(&sunday)) % 7 - 1;
 #endif
 	before = after = -1;
 

Reply via email to