Skip to content

Conversation

@octoaide
Copy link
Contributor

@octoaide octoaide bot commented Sep 30, 2025

Closes #178

This pull request replaces the chrono crate with jiff for all date and time handling throughout the codebase.

Motivation

jiff is a better-maintained library that provides a more modern and robust approach to date/time handling in Rust compared to chrono. This migration improves the long-term maintainability and reliability of our date/time operations.

Summary of Changes

  • Added jiff as a dependency, including the serde feature.
  • Removed chrono as a dependency from Cargo.toml.
  • Migrated all usages of chrono to jiff in src/stats.rs, src/table.rs, and src/csv/reader.rs.
  • Updated date/time parsing, formatting, and manipulation logic to use jiff's API, including:
    • chrono::NaiveDateTime replaced with jiff::civil::DateTime
    • NaiveDate::from_ymd_opt().and_hms_opt() -> date().at()
    • DateTime::from_timestamp() -> jiff::Timestamp::from_second()
    • .and_utc().timestamp_nanos_opt() -> .to_zoned(TimeZone::UTC).timestamp().as_nanosecond()
    • chrono::format::ParseError -> jiff::Error
    • .format() -> .strftime()
  • Updated all relevant unit tests to reflect the jiff API.
  • Added an entry to CHANGELOG.md documenting this dependency switch.
  • Confirmed all tests pass and no new clippy warnings are introduced.

This change ensures that functionality remains fully backward compatible while leveraging the benefits of jiff.

@octoaide octoaide bot requested a review from msk September 30, 2025 01:01
@msk msk self-assigned this Sep 30, 2025
@msk msk merged commit fe1a068 into main Sep 30, 2025
10 checks passed
@msk msk deleted the octoaide/replace-chrono-with-jiff branch September 30, 2025 20:19
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.

Replace chrono with jiff for date/time handling

2 participants