Discussion:
Start week from Monday in cal(1)
(too old to reply)
justsomelessons
2024-06-09 16:25:37 UTC
Permalink
Hello!

As you can find, FreeBSD cal(1) man page says that
"It is not possible to display Monday as the first day of the week with cal".

But daily it is more comfortable if weeks start from Monday.
I know that there is ncal (vertical) mode which always starts from Monday,
but any other calendar in the world (software or that on the wall) is
horizontal,
so ncal is uncomfortable too.
So I've made a simple patch that adds -M option to cal(1) to start
week from Monday:
https://codeberg.org/vall/stuff/src/branch/main/ncalfixed

By the way, Debian also has set of patches that adds such option:
https://salsa.debian.org/meskes/bsdmainutils/-/tree/master/debian/patches

Can I ask if such an option can be added to the FreeBSD base?
It's highly appreciative if my tiny patches with or without
modifications can be helpful.
Or are there historical or some other reasons for nonpossibility to
start weeks from Monday?

Thank you!
-----
Best regards,
Valentine Astakhov.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Warner Losh
2024-06-11 02:45:06 UTC
Permalink
Post by justsomelessons
Hello!
As you can find, FreeBSD cal(1) man page says that
"It is not possible to display Monday as the first day of the week with cal".
But daily it is more comfortable if weeks start from Monday.
I know that there is ncal (vertical) mode which always starts from Monday,
but any other calendar in the world (software or that on the wall) is
horizontal,
so ncal is uncomfortable too.
So I've made a simple patch that adds -M option to cal(1) to start
https://codeberg.org/vall/stuff/src/branch/main/ncalfixed
These look quite interesting. I've not had a chance to test them, but
the code changes look good, and not invasive.

Is there a chance you'd be able to submit them via a github pull request
against https://github.com/freebsd/freebsd-src? That would be the best way
currently to make sure this doesn't get lost and will make its way into the
tree, or at least get feedback about what's needed to do so...

Warner
Post by justsomelessons
https://salsa.debian.org/meskes/bsdmainutils/-/tree/master/debian/patches
Can I ask if such an option can be added to the FreeBSD base?
It's highly appreciative if my tiny patches with or without
modifications can be helpful.
Or are there historical or some other reasons for nonpossibility to
start weeks from Monday?
Thank you!
-----
Best regards,
Valentine Astakhov.
justsomelessons
2024-06-11 20:23:55 UTC
Permalink
Thank you!
I'll try to make a pull request.
Post by Warner Losh
These look quite interesting. I've not had a chance to test them, but
the code changes look good, and not invasive.
Is there a chance you'd be able to submit them via a github pull request against https://github.com/freebsd/freebsd-src? That would be the best way currently to make sure this doesn't get lost and will make its way into the tree, or at least get feedback about what's needed to do so...
Warner
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Warner Losh
2024-06-11 21:05:59 UTC
Permalink
Great!

Please let me know if you hit any snags.

Warner
Post by justsomelessons
Thank you!
I'll try to make a pull request.
Post by Warner Losh
These look quite interesting. I've not had a chance to test them, but
the code changes look good, and not invasive.
Is there a chance you'd be able to submit them via a github pull request
against https://github.com/freebsd/freebsd-src? That would be the best
way currently to make sure this doesn't get lost and will make its way into
the tree, or at least get feedback about what's needed to do so...
Post by Warner Losh
Warner
Loading...