Skip to content

Commit 6eb1d48

Browse files
committed
ADD: Add chrono feature for datetime conversions
1 parent 2eea435 commit 6eb1d48

File tree

10 files changed

+484
-31
lines changed

10 files changed

+484
-31
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
## 0.37.0 - TBD
44

5+
### Enhancements
6+
- Added optional `chrono` feature for converting `chrono` date and datetime types to
7+
`DateRange`, `DateTimeRange`, and `Subscription::start` (credit: @wtn)
8+
59
### Breaking changes
610
- Changed the default to `true` for the `map_symbols` parameter in
711
`SubmitJobParams::builder()` for JSON and CSV encodings
12+
- Moved `DateTimeLike` trait to top level
813

914
### Bug fixes
1015
- Fixed checksum verification for resumed downloads in `batch().download()`. Previously,

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)