mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 01:35:36 +00:00
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
This commit is contained in:
parent
884c6459e4
commit
96a900e0b8
2 changed files with 10 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 │
|
||||
╞════════════╪════════╪══════════════╪════════════╪══════════════════════════════════════════════════════════════════════════╡
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue