Skip to content

Comments

Add iso date format and dual-line date format support#1189

Open
manno wants to merge 2 commits intolsd-rs:mainfrom
manno:parse-time-style-env
Open

Add iso date format and dual-line date format support#1189
manno wants to merge 2 commits intolsd-rs:mainfrom
manno:parse-time-style-env

Conversation

@manno
Copy link

@manno manno commented Feb 19, 2026

Refers to #554, this is now much easier to implement than before (#600).
I should note, this PR was created with AI assistance 🤖.


Adds two enhancements to the --date flag:

  • previously iso was only usable via the TIME_STYLE environment variable. It is now a valid value for --date and the config file.
  • dual-line format: DateFlag::Formatted now accepts two patterns separated by a newline (e.g. +%F\n%H:%M). The first format is used for older files (>6 months), the second for recent files. This correctly parses GNU coreutils TIME_STYLE dual-format values.

TODO

  • Use cargo fmt
  • Add necessary tests
  • Update README (if applicable)
  • Update config sample file in doc/samples (if applicable)
  • Update icon sample file in doc/samples (if applicable)
  • Update color sample file in doc/samples (if applicable)
  • Update man page at lsd/doc/lsd.md (if applicable)

manno and others added 2 commits December 12, 2025 00:31
Previously, the --date flag did not support ISO format. It was only
affected in the TIME_STYLE environment variable.
Allow DateFlag::Formatted to accept two formats separated by a newline.
Recent files use the second format, older files use the first. Add tests
to verify correct formatting based on file age.
This corrctly parses Gnu coreutils time styles
@manno manno requested a review from zwpaper as a code owner February 19, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant