Skip to content

Commit

Permalink
impl comparisons for DateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Dec 14, 2023
1 parent 6ea2b6b commit 07ab30b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ensemble/src/types/datetime.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use fastdate::Date;

Check warning on line 1 in ensemble/src/types/datetime.rs

View workflow job for this annotation

GitHub Actions / Test Suite

unused import: `fastdate::Date`
use rbs::Value;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
use std::{
Expand Down Expand Up @@ -134,6 +135,12 @@ impl Sub<Duration> for DateTime {
}
}

impl PartialOrd for DateTime {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
}
}

impl FromStr for DateTime {
type Err = rbs::Error;

Expand Down

0 comments on commit 07ab30b

Please sign in to comment.