Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
postgres = { version = "0.15", features = ["with-time"] }
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -155,6 +158,17 @@ impl Normalizable for Timespec {
}
}

impl<T> Normalizable for DateTime<T>
where T: TimeZone {
fn normalize<S>(bound: RangeBound<S, DateTime<T>>) -> RangeBound<S, DateTime<T>>
where
S: BoundSided,
{
bound
}
}


/// The possible sides of a bound.
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum BoundSide {
Expand Down