diff options
-rw-r--r-- | src/datetime.rs | 9 | ||||
-rw-r--r-- | src/rrulestr.rs | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/datetime.rs b/src/datetime.rs index 4702e0e..8099ad4 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -1,14 +1,9 @@ use chrono::prelude::*; -use chrono_tz::Tz; +use chrono::Utc; +use chrono_tz::{Tz}; pub type DTime = DateTime<Tz>; -// pub fn from_ordinal(ordinal: isize) -> DateTime<Utc> { -// let timestamp = ordinal * 24 * 60 * 60; -// let naive = NaiveDateTime::from_timestamp(timestamp as i64, 0); -// DateTime::from_utc(naive, Utc) -// } - pub fn from_ordinal(ordinal: isize, tz: &Tz) -> DTime { let timestamp = ordinal * 24 * 60 * 60; tz.timestamp(timestamp as i64, 0) diff --git a/src/rrulestr.rs b/src/rrulestr.rs index 7581ab9..20670f8 100644 --- a/src/rrulestr.rs +++ b/src/rrulestr.rs @@ -175,7 +175,7 @@ fn parse_rrule(line: &str) -> Result<Options, RRuleParseError> { options.bysetpos = Some(bysetpos); } "BYMONTH" => { - let bymonth = stringval_to_intvec(value, |month| month >= 0 && month <= 11, format!("Invalid bymonth value"))?; + let bymonth = stringval_to_intvec(value, |month| month <= 11, format!("Invalid bymonth value"))?; options.bymonth = Some(bymonth); } "BYMONTHDAY" => { |