Compare start/end time.
This commit is contained in:
@@ -189,6 +189,8 @@ pub struct Timestamp<'s> {
|
||||
pub range_type: TimestampRangeType,
|
||||
pub start: Option<Date<'s>>,
|
||||
pub end: Option<Date<'s>>,
|
||||
pub start_time: Option<Time<'s>>,
|
||||
pub end_time: Option<Time<'s>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -273,7 +275,7 @@ impl Hour {
|
||||
// TODO: Make a real error type instead of a boxed any error.
|
||||
pub fn new<'s>(source: &'s str) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let hour = source.parse::<HourInner>()?;
|
||||
if hour < 1 || hour > 23 {
|
||||
if hour > 23 {
|
||||
Err("Hour exceeds possible range.")?;
|
||||
}
|
||||
Ok(Hour(hour))
|
||||
@@ -288,7 +290,7 @@ impl Minute {
|
||||
// TODO: Make a real error type instead of a boxed any error.
|
||||
pub fn new<'s>(source: &'s str) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let minute = source.parse::<MinuteInner>()?;
|
||||
if minute < 1 || minute > 59 {
|
||||
if minute > 59 {
|
||||
Err("Minute exceeds possible range.")?;
|
||||
}
|
||||
Ok(Minute(minute))
|
||||
|
||||
Reference in New Issue
Block a user