Comment 3 for bug 229757

Revision history for this message
Volodymyr M. Lisivka (vlisivka-gmail) wrote :

I am author of current Ukrainian locale. The problem with "cal" is described in it code. Cal is written in 2001 and not supported after that. Here is the comment from the source code:

---------------------------------------------------------------------------------------------------------------
#if 0 /* setting week1stday is against man page */
/*
 * What *is* the first day of the week? Note that glibc does not
 * provide any information today, it (almost) always answers Monday.
 * Sunday is the Jewish and Christian tradition.
 * Sometimes an answer is built into the language:
 * German calls Wednesday "Mittwoch", so starts at Sunday.
 * Portuguese calls Monday "segunda-feira", so starts at Sunday.
 * Russian calls Friday "pyatnitsa", so starts at Monday.
 * ISO 8601 decided to start at Monday.
 *
 * The traditional Unix cal utility starts at Sunday.
 * We start at Sunday and have an option -m for starting at Monday.
 *
 * At some future time this may become -s for Sunday, -m for Monday,
 * no option for glibc-determined locale-dependent version.
 */
#ifdef HAVE_LANGINFO_H
        week1stday = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0];
#endif
#endif
---------------------------------------------------------------------------------------------------------------

If you will uncomment this code, then cal will behave properly:

---------------------------------------------------------------------------------------------------------------
-(~/rpmbuild/SPECS:$)-> cat ~/rpmbuild/SOURCES/util-linux-ng-2.13-week1stday.patch
diff -rub util-linux-ng-2.13.1.orig/misc-utils/cal.c util-linux-ng-2.13.1/misc-utils/cal.c
--- util-linux-ng-2.13.1.orig/misc-utils/cal.c 2008-01-16 11:31:41.000000000 +0200
+++ util-linux-ng-2.13.1/misc-utils/cal.c 2008-05-14 14:46:08.000000000 +0300
@@ -285,7 +285,7 @@
  }
 #endif

-#if 0 /* setting week1stday is against man page */
+#if 1 /* setting week1stday is against man page */
 /*
  * What *is* the first day of the week? Note that glibc does not
  * provide any information today, it (almost) always answers Monday.

-(~/rpmbuild/SPECS:$)-> cal
    травень 2008
пн вт ср чт пт сб нд
     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 31

---------------------------------------------------------------------------------------------------------------

Please, do not use this outdated command to make any decisions about Ukrainian locale.

If somebody has questions or proposals about current Ukrainian locale, call me by email, or start discussion on linux.org.ua site first.

See also http://linux.org.ua/cgi-bin/yabb/YaBB.pl?num=1210279358 .

PLEASE, revert the change to Ukrainian locale, change first_weekday and
first_workday to 1. I do not want receive bug reports from Ubuntu users anymore (I am Fedora user).