From 8d4e539d02527a6baa6c88790ab01a562010fd18 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Fri, 9 Oct 2026 09:48:59 -0400 Subject: [PATCH] LRC-LIB-SMARTCOLL: a date with a zone straight after the day is DateWithZone From review: "2026-08-14Z" (a zone after a date with no time) was reported as "needs a date" rather than as the time-zone issue it is. Co-Authored-By: Claude Opus 5.5 --- crates/catalog/src/rules.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/catalog/src/rules.rs b/crates/catalog/src/rules.rs index 64029fd82..a167cce25 100644 --- a/crates/catalog/src/rules.rs +++ b/crates/catalog/src/rules.rs @@ -345,7 +345,7 @@ pub fn rule_date(s: &str) -> Result { }; if !shaped(&s) { // a whole date and time with something after it: a zone (+02:00, -05:00, Z) or a fraction - let zoned = [19, 16, 13].iter().any(|&n| { + let zoned = [19, 16, 13, 10].iter().any(|&n| { s.get(..n).is_some_and(shaped) && s.get(n..).and_then(|rest| rest.chars().next()).is_some_and(|c| matches!(c, '+' | '-' | 'Z' | 'z' | '.')) }); @@ -1478,7 +1478,7 @@ mod tests { let r = rule(op, v.clone()); assert!(r.check(&cat).is_empty() && r.matches(&p, &cat), "{op} {v}"); } - for v in ["2026-08-14T10:00:00+02:00", "2026-08-14T10:00:00Z", "2026-08-14T10:00:00.25", "2026-08-14 10:00-05:00"] { + for v in ["2026-08-14T10:00:00+02:00", "2026-08-14T10:00:00Z", "2026-08-14T10:00:00.25", "2026-08-14 10:00-05:00", "2026-08-14Z"] { let p = rule("is", json!(v)).check(&cat); assert_eq!(p.first().map(|p| p.issue), Some(Issue::DateWithZone), "{v}"); }