-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
date: fix %Z specifier does not print TZ abbr #5164
Open
KrishnaNagam
wants to merge
21
commits into
uutils:main
Choose a base branch
from
KrishnaNagam:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
510c73a
fix: replace %Z specifier with locale TZ abbr
KrishnaNagam 1fad29c
formatted code with cargo fmt
KrishnaNagam f5a4e54
date: added cargo.lock changes
KrishnaNagam ab2b30c
Moved iana-time-zone, chrono-tz to root cargo.toml
KrishnaNagam c1ca29e
Merge branch 'uutils:main' into main
KrishnaNagam 39f3318
Merge branch 'uutils:main' into main
KrishnaNagam be50227
Merge branch 'main' into main
KrishnaNagam 1b78a3a
Merge branch 'main' into main
sylvestre 6c636d8
Merge branch 'main' into main
sylvestre c118bdc
Merge branch 'main' into main
tertsdiepraam ba41cdb
Merge remote-tracking branch 'upstream/main'
KrishnaNagam 140e108
fix chrono imports
KrishnaNagam 4dd0dfc
fix test cases;
KrishnaNagam 9f97969
cargo fmt date.rs
KrishnaNagam a196ea6
Seperated test case for macos
KrishnaNagam 543b017
cargo fmt
KrishnaNagam 2609582
fix Cargo.lock
KrishnaNagam 4e434ea
Merge pull request #3 fix Cargo.lock
KrishnaNagam 3246522
Merge branch 'main' into main
KrishnaNagam 06158ac
Merge branch 'main' into main
KrishnaNagam 2033816
Merge branch 'main' into main
sylvestre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -428,6 +428,7 @@ fn test_date_parse_from_format() { | |
} | ||
|
||
#[test] | ||
#[cfg(not(target_os = "macos"))] | ||
fn test_date_from_stdin() { | ||
new_ucmd!() | ||
.arg("-f") | ||
|
@@ -439,8 +440,27 @@ fn test_date_from_stdin() { | |
) | ||
.succeeds() | ||
.stdout_is( | ||
"Mon Mar 27 08:30:00 2023\n\ | ||
Sat Apr 1 12:00:00 2023\n\ | ||
Sat Apr 15 18:30:00 2023\n", | ||
"Mon Mar 27 08:30:00 UTC 2023\n\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tertsdiepraam |
||
Sat Apr 1 12:00:00 UTC 2023\n\ | ||
Sat Apr 15 18:30:00 UTC 2023\n", | ||
); | ||
} | ||
|
||
#[test] | ||
#[cfg(target_os = "macos")] | ||
fn test_date_from_stdin() { | ||
new_ucmd!() | ||
.arg("-f") | ||
.arg("-") | ||
.pipe_in( | ||
"2023-03-27 08:30:00\n\ | ||
2023-04-01 12:00:00\n\ | ||
2023-04-15 18:30:00\n", | ||
) | ||
.succeeds() | ||
.stdout_is( | ||
"Mon Mar 27 08:30:00 GMT 2023\n\ | ||
Sat Apr 1 12:00:00 GMT 2023\n\ | ||
Sat Apr 15 18:30:00 GMT 2023\n", | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not quite correct, because this means that
%f
should be escaped. Ultimately, we might need to completely customize this. I suppose it's good enough for now though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this line of code was already there. Cargo fmt has put it in new line 😀. I am interested in solving this though in my next PR.
I didn't get why %f need to be escaped. Did you mean, if there is %f already within the input, it should be escaped?