Skip to content

Commit 39aafb5

Browse files
wtnclaude
andcommitted
ADD: Add optional chrono feature for date/datetime conversions
Co-authored-by: Claude <[email protected]>
1 parent 44a0ffe commit 39aafb5

File tree

7 files changed

+481
-19
lines changed

7 files changed

+481
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.37.0 - TBD
4+
5+
### Enhancements
6+
- Added optional `chrono` feature for converting `chrono` date and datetime types to
7+
`DateRange`, `DateTimeRange`, and `Subscription::start` (credit: @wtn)
8+
39
## 0.36.0 - 2025-11-19
410

511
### Enhancements

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ historical = [
3030
"tokio/fs"
3131
]
3232
live = ["tokio/net"]
33+
chrono = ["dep:chrono"]
3334

3435
[dependencies]
3536
dbn = { version = "0.44.0", features = ["async", "serde"] }
3637

3738
async-compression = { version = "0.4", features = ["tokio", "zstd"], optional = true }
39+
chrono = { version = ">=0.4.34", optional = true, default-features = false, features = ["alloc"] }
3840
# Async stream trait
3941
futures = { version = "0.3", optional = true }
4042
# Used for Live authentication and historical checksums
@@ -55,6 +57,7 @@ zstd = { version = "0.13", optional = true }
5557

5658
[dev-dependencies]
5759
anyhow = "1.0.100"
60+
chrono = { version = ">=0.4.34", default-features = false, features = ["alloc"] }
5861
async-compression = { version = "0.4", features = ["tokio", "zstd"] }
5962
clap = { version = "4.5.51", features = ["derive"] }
6063
rstest = "0.26.1"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ cargo add databento
2626

2727
- `historical`: enables the historical client for data older than 24 hours
2828
- `live`: enables the live client for real-time and intraday historical data
29+
- `chrono`: enables passing `chrono` types as datetime parameters
2930

3031
By default both features are enabled and the historical client uses OpenSSL for TLS.
3132
To use `rustls`, disable default features for both the databento crate and [reqwest](https://github.com/seanmonstar/reqwest).

0 commit comments

Comments
 (0)