date: fix %#P case-swap on lowercase am/pm

This commit is contained in:
vishakha1411
2026-04-06 09:48:18 +02:00
committed by Daniel Hofstetter
parent db9a111c18
commit b41d591cde
2 changed files with 4 additions and 2 deletions
+4 -1
View File
@@ -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();
}
}
-1
View File
@@ -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!()