cal -m doesn't work anymore

Bug #604366 reported by mrq1
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
bsdmainutils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: bsdmainutils

output of karmic version:
~>>> /media/karmic/usr/bin/cal -m
     July 2010
Mo Tu We Th Fr Sa Su
          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

lucid version:
~>>> /usr/bin/cal -m
/usr/bin/cal: option requires an argument -- 'm'
usage: cal [-hjy] [[month] year]
       cal [-hj] [-m month] [year]
       ncal [-hJjpwy] [-s country_code] [[month] year]
       ncal [-hJeo] [year]

in the manpage is no option for getting the start of
week on monday anymore (like in karmic and before...)

Revision history for this message
Michael Meskes (meskes) wrote :

Not sure which version you are using but there is the new option '-M' doing what '-m' did before.

Revision history for this message
mrq1 (kubuntu-bugreporter) wrote :

does not work with maverick:

>>> unalias cal
>>> cal -M
usage: cal [-hjy] [[month] year]
       cal [-hj] [-m month] [year]
       ncal [-hJjpwy3MS] [-s country_code] [[month] year]
       ncal [-hJeo] [year]

seems to work only via "ncal"
>>> unalias ncal
>>> ncal -M
    December 2010
Mo 6 13 20 27
Tu 7 14 21 28
We 1 8 15 22 29
Th 2 9 16 23 30
Fr 3 10 17 24 31
Sa 4 11 18 25
Su 5 12 19 26

thats REALY strange:
>>> ncal -S
    December 2010
Su 6 13 20 27
Mo 7 14 21 28
Tu 1 8 15 22 29
We 2 9 16 23 30
Th 3 10 17 24 31
Fr 4 11 18 25
Sa 5 12 19 26

the layout (Su first) changes but the layout of the days does not chance
that CANT be correct!

Changed in bsdmainutils (Ubuntu):
status: New → Confirmed
Revision history for this message
Ralph Corderoy (ralph-inputplus) wrote :

I think the title of this bug is misleading. cal's -m option has become ncal's -M, that fine. But ncal's -S option compared to -M prints the dates in the same place but shifts the days of the week labels; as mrq1 wrote "that CANT be correct".

To show the problem, just do "ncal -M; ncal -S" and study the output. I suggest the title be changed to "ncal incorrect if asked for weeks starting Sunday with -S". And the priority should be higher than normal. I very nearly made a real muck-up here because I trusted ncal's output without a second thought.

The above is 10.10. I think it may have been fixed in 11.04; could someone test please. But given the potential impact of using a wrong calendar perhaps the fix needs back-porting?

Revision history for this message
inye (j-contrerasferrada) wrote :

I use ubuntu 11.04 but the bug still here. :(

description: updated
Revision history for this message
Michael Wayne Goodman (goodmami) wrote :

According to the man page, "The cal utility displays a simple calendar in traditional format and ncal offers an alternative layout...", so the switched axes are not a problem with ncal. But I do observe the problem that the -M option does not cause the week to start with Monday with cal.

$ cal -M
Usage: cal [general options] [-hjy] [[month] year]
       cal [general options] [-hj] [-m month] [year]
       ncal [general options] [-bhJjpwySM] [-s country_code] [[month] year]
       ncal [general options] [-bhJeoSM] [year]
General options: [-NC3] [-A months] [-B months]
For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]
$ ncal -M
    November 2011
Mo 7 14 21 28
Tu 1 8 15 22 29
We 2 9 16 23 30
Th 3 10 17 24
Fr 4 11 18 25
Sa 5 12 19 26
Su 6 13 20 27

I get similar results with -S (works for ncal, doesn't for cal).

I am running Ubuntu 11.10

Revision history for this message
Michael Wayne Goodman (goodmami) wrote :

The man page is shared for cal and ncal, and it says ncal has more options, so it may be the case that the -M option is only for ncal. Until this gets fixed, I came up with the following workaround:

$ ncal -M -C
   November 2011
Mo Tu We Th Fr Sa Su
    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

Using ncal, the -M option starts the week on Monday, and the -C option uses cal-style formatting.

Revision history for this message
Ralph Corderoy (ralph-inputplus) wrote :

Here's a trivial example of the bug.

    $ ncal -M
        January 2012
    Mo 2 9 16 23 30
    Tu 3 10 17 24 31
    We 4 11 18 25
    Th 5 12 19 26
    Fr 6 13 20 27
    Sa 7 14 21 28
    Su 1 8 15 22 29
    $ ncal -S
        January 2012
    Su 2 9 16 23 30
    Mo 3 10 17 24 31
    Tu 4 11 18 25
    We 5 12 19 26
    Th 6 13 20 27
    Fr 7 14 21 28
    Sa 1 8 15 22 29
    $

Was New Year's day this year a Sunday or a Saturday? The importance of
this bug *must* be high because people, including me, look at the output
of ncal to make real-life decisions and announcements affecting others.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

I will mark this ticket as a dupe to bug 908233.

ncal -S now works correctly in precise. If you want to argue for a backported fix to lucid, please open a new ticket. If you let me know about it, I can even mark it high prio.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.