diff --git a/src/datetime.rs b/src/datetime.rs index 074b973..1e53753 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -575,8 +575,8 @@ impl PartialEq> for DateTime { impl Eq for DateTime { } -impl PartialOrd for DateTime { - fn partial_cmp(&self, other: &DateTime) -> Option { +impl PartialOrd> for DateTime { + fn partial_cmp(&self, other: &DateTime) -> Option { self.datetime.partial_cmp(&other.datetime) } } @@ -2032,6 +2032,9 @@ mod tests { assert_eq!(d.date(), tz.ymd(2017, 8, 9)); assert_eq!(d.date().naive_local(), NaiveDate::from_ymd(2017, 8, 9)); assert_eq!(d.date().and_time(d.time()), Some(d)); + + let utc_d = Utc.ymd(2017, 8, 9).and_hms(12, 34, 56); + assert!(utc_d < d); } #[test]