Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cal does not respect LC_TIME #12829

Open
reactormonk opened this issue May 10, 2024 · 2 comments
Open

cal does not respect LC_TIME #12829

reactormonk opened this issue May 10, 2024 · 2 comments
Labels
enhancement New feature or request localization Issues relating to i18n and locale for display formats POSIX-expectations Touches on behavior found in other (POSIX-compliant) shells. We need to consider if we follow that

Comments

@reactormonk
Copy link

Describe the bug

Invoking cal lists the current date in a calendar starting on Sunday, which is common for one half of the world. For the other half, it should also be "correct".

https://www.timeanddate.com/calendar/days/first-day-of-the-week.html

How to reproduce

Invoke cal on a machine with these settings:

❯ $env.LC_TIME
de_DE.UTF-8

Expected behavior

cal should return the week starting on Monday with these LC_TIME settings.

Screenshots

No response

Configuration

key value
version 0.92.2
branch makepkg
commit_hash 2a08a18
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.77.1 (7cf61ebde 2024-03-27) (Arch Linux rust 1:1.77.1-2)
cargo_version cargo 1.77.1
build_time 2024-04-11 08:40:50 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, sqlite, trash, which
installed_plugins query

Additional context

No response

@reactormonk reactormonk added the needs-triage An issue that hasn't had any proper look label May 10, 2024
@fdncred
Copy link
Collaborator

fdncred commented May 10, 2024

This is why cal has a --week-start parameter. I'm not convinced we should turn cal into a unix-only tool that relies on unix things. Windows doesn't understand what LC_TIME is.

@sholderbach sholderbach added enhancement New feature or request POSIX-expectations Touches on behavior found in other (POSIX-compliant) shells. We need to consider if we follow that localization Issues relating to i18n and locale for display formats and removed needs-triage An issue that hasn't had any proper look labels May 11, 2024
@reactormonk
Copy link
Author

The Windows APIs are different: https://stackoverflow.com/a/39344961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request localization Issues relating to i18n and locale for display formats POSIX-expectations Touches on behavior found in other (POSIX-compliant) shells. We need to consider if we follow that
Projects
None yet
Development

No branches or pull requests

3 participants