mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
date: fix %#P case-swap on lowercase am/pm
This commit is contained in:
committed by
Daniel Hofstetter
parent
db9a111c18
commit
b41d591cde
@@ -337,7 +337,10 @@ fn apply_modifiers(
|
||||
.all(|c| !c.is_alphabetic() || c.is_uppercase())
|
||||
{
|
||||
result = result.to_lowercase();
|
||||
} else {
|
||||
} else if !result
|
||||
.chars()
|
||||
.all(|c| !c.is_alphabetic() || c.is_lowercase())
|
||||
{
|
||||
result = result.to_uppercase();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1888,7 +1888,6 @@ fn test_date_input_trailing_tz_abbrev_rezones() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "https://github.com/uutils/coreutils/issues/11659 — GNU date treats the `#` case-swap flag as no-op on `%P` (already-lowercase alt); uutils uppercases it to `PM`."]
|
||||
fn test_date_strftime_case_flag_on_alt_ampm() {
|
||||
// `%P` is GNU's lowercase am/pm. `%#P` should stay lowercase in GNU; uutils flips to `PM`.
|
||||
new_ucmd!()
|
||||
|
||||
Reference in New Issue
Block a user