From 96a900e0b883e034707cf36ddddaaf7b1310a06e Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Wed, 4 Nov 2026 21:04:24 +0700 Subject: [PATCH] fix(calendar): say when the table holds offers opened before --from Open offers are listed by the day they opened, so "from 2026-11-03 to 2026-11-12" sat above tenders dated in October (Pullfrog on #78). The title adds "with offers opened earlier and still open" when such rows are there. Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY --- crates/idx-cli/src/output/table.rs | 10 +++++++++- .../tests/golden/stockbit-calendar.table.golden | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/idx-cli/src/output/table.rs b/crates/idx-cli/src/output/table.rs index 45ecc93..945f731 100644 --- a/crates/idx-cli/src/output/table.rs +++ b/crates/idx-cli/src/output/table.rs @@ -1864,10 +1864,18 @@ pub fn print_corporate_calendar( range: &CalendarRange, actions: &[CorporateAction], ) -> Result<(), IdxError> { + // Offers still open are listed by the day they opened, which can be + // before `from`; the title says so rather than claim the range bounds + // every row. + let earlier = if actions.iter().any(|a| a.date < range.from) { + ", with offers opened earlier and still open" + } else { + "" + }; println!( "{}", format!( - "Corporate actions from {} to {} ({})", + "Corporate actions from {} to {}{earlier} ({})", range.from, range.to, actions.len() diff --git a/crates/idx-cli/tests/golden/stockbit-calendar.table.golden b/crates/idx-cli/tests/golden/stockbit-calendar.table.golden index 9ddb54e..7376ced 100644 --- a/crates/idx-cli/tests/golden/stockbit-calendar.table.golden +++ b/crates/idx-cli/tests/golden/stockbit-calendar.table.golden @@ -1,6 +1,6 @@ exit: 0 --- stdout -Corporate actions from 2026-11-03 to 2026-11-12 (17) +Corporate actions from 2026-11-03 to 2026-11-12, with offers opened earlier and still open (17) ┌────────────┬────────┬──────────────┬────────────┬──────────────────────────────────────────────────────────────────────────┐ │ DATE ┆ SYMBOL ┆ KIND ┆ EX ┆ DETAIL │ ╞════════════╪════════╪══════════════╪════════════╪══════════════════════════════════════════════════════════════════════════╡