public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] week numbers for cal
@ 2013-10-05 20:59 Tommi Kyntola
  2013-10-06 15:29 ` Sami Kerola
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Tommi Kyntola @ 2013-10-05 20:59 UTC (permalink / raw)
  To: util-linux-ng

I keep trying -w with cal from time to time and I finally decided it's
about time to do something about it. I'm not sure if this is something
you'd be interested in incorporating into util-linux cal, but it's
something I wanted, so here it is. There's gcal of course, but I only
wanted a toothpick not the whole forest.

I added -w|--week for showing week numbers. It defaults to North
American numbering, because cal itself defaults to Sundays being the
first day of the week. With Monday first it uses the ISO-8601 week
numbers.

I didn't worry too much about the implementation being as clean as
possible just yet, but should this be deemed worth a jack, I or anyone
else can take it to any direction.

The three relevant patches are in my github:
https://github.com/Kynde/util-linux.git
https://github.com/Kynde/util-linux/commits

Tommi Kyntola (4):
      cal: added two missing tests
      cal: added -w|--week for showing week numbers
      cal: tests for week number modes added
      cal: added more week number tests to cover various special cases

The first that's on top of Karel's tree is a minor test fix for
bigyear and sep1752 which seemed to lack final their last tests.

 misc-utils/cal.c            |  140 +++-
 tests/expected/cal/1mw      |   37 ++
 tests/expected/cal/3mw      |   37 ++
 tests/expected/cal/bigyear  |   51 ++
 tests/expected/cal/bigyearw |  257 ++++++++
 tests/expected/cal/colorw   |   55 ++
 tests/expected/cal/sep1752  |   51 ++
 tests/expected/cal/sep1752w |  249 ++++++++
 tests/expected/cal/weeknum  | 1485 +++++++++++++++++++++++++++++++++++++++++++
 tests/expected/cal/yearw    |  177 ++++++
 tests/ts/cal/1mw            |   59 ++
 tests/ts/cal/3mw            |   58 ++
 tests/ts/cal/bigyear        |    1 +
 tests/ts/cal/bigyearw       |   96 +++
 tests/ts/cal/colorw         |   71 +++
 tests/ts/cal/sep1752        |    1 +
 tests/ts/cal/sep1752w       |   96 +++
 tests/ts/cal/weeknum        |   87 +++
 tests/ts/cal/yearw          |   58 ++
 19 files changed, 3037 insertions(+), 29 deletions(-)


Please cc me as I'm not on the list.

cheers,
Tommi Kyntola

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-10-23  6:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05 20:59 [RFC/PATCH] week numbers for cal Tommi Kyntola
2013-10-06 15:29 ` Sami Kerola
2013-10-06 17:23   ` Tommi Kyntola
2013-10-06 18:38     ` Benno Schulenberg
2013-10-07  3:10     ` Pádraig Brady
2013-10-07 11:39       ` Tommi Kyntola
2013-10-07 17:06         ` Pádraig Brady
2013-10-07 17:59           ` Tommi Kyntola
2013-10-07 23:33             ` Pádraig Brady
2013-10-09  9:43 ` Karel Zak
2013-10-22 10:32 ` Karel Zak
2013-10-22 15:23   ` Sami Kerola
2013-10-22 15:55     ` Karel Zak
2013-10-23  6:56   ` Tommi Kyntola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox