diff --git a/Cargo.toml b/Cargo.toml index 7c27408..19e2ec8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,8 @@ documentation = "https://sfackler.github.io/rust-postgres-range/doc/v0.9.0/postg time = "0.1" postgres = "0.15" postgres-protocol = "0.3" +chrono = "0.4.0" +postgres-shared = { version = "0.4.0", features = ["with-chrono"] } [dev-dependencies] -postgres = { version = "0.15", features = ["with-time"] } \ No newline at end of file +postgres = { version = "0.15", features = ["with-time"] } diff --git a/src/lib.rs b/src/lib.rs index 55ffa69..5b28546 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,10 @@ #[macro_use(to_sql_checked)] extern crate postgres; extern crate postgres_protocol; +extern crate postgres_shared; extern crate time; +extern crate chrono; +use chrono::{DateTime, TimeZone}; use std::cmp::Ordering; use std::fmt; @@ -155,6 +158,17 @@ impl Normalizable for Timespec { } } +impl Normalizable for DateTime + where T: TimeZone { + fn normalize(bound: RangeBound>) -> RangeBound> + where + S: BoundSided, + { + bound + } +} + + /// The possible sides of a bound. #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum BoundSide {