Skip to content

fix: support bare years in datetime subtraction#202

Merged
konard merged 3 commits into
mainfrom
issue-201-6df4deefbd37
Jul 16, 2026
Merged

fix: support bare years in datetime subtraction#202
konard merged 3 commits into
mainfrom
issue-201-6df4deefbd37

Conversation

@konard

@konard konard commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • interpret an unadorned four-digit year as January 1 when subtracting it from a datetime
  • support the same coercion when the bare year is the left operand
  • preserve ordinary numeric subtraction and reject out-of-range year coercion

Reproduction

Before this change, (now - 2023) in months failed with Cannot subtract number from datetime.

Verification

  • added tests/issue_201_bare_year_datetime_tests.rs covering the reported expression, both operand orders, equivalent explicit January 1 dates, numeric arithmetic, and an invalid year
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features
  • node scripts/check-file-size.mjs
  • cargo test --all-features
  • cargo test --doc --all-features

Fixes #201

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #201
@konard konard self-assigned this Jul 16, 2026
@konard konard changed the title [WIP] Unrecognized input: (now - 2023) in months fix: support bare years in datetime subtraction Jul 16, 2026
@konard
konard marked this pull request as ready for review July 16, 2026 10:11
@konard

konard commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented and finalized PR #202.

  • (now - 2023) in months now works.
  • Bare four-digit years resolve to January 1 during datetime subtraction.
  • Both operand orders are supported.
  • Normal numeric arithmetic remains unchanged.
  • Added regression tests and a changelog fragment.
  • Local formatting, Clippy, file-size checks, full tests, and doc tests pass.
  • Fresh CI passed all applicable Rust, WASM, package, and web checks.
  • PR is clean, mergeable, and ready for review.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $9.309731

📊 Context and tokens usage:

  • 162.9K / 200K (81%) input tokens, 13.9K / 128K (11%) output tokens

Total: (162.9K + 7.1M cached) input tokens, 13.9K output tokens, $9.309731 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: low (~7999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (2189KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit 643578b into main Jul 16, 2026
14 checks passed
@konard

konard commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unrecognized input: (now - 2023) in months

1 participant