Reexport chrono duration
This commit is contained in:
		
							parent
							
								
									e86729f23e
								
							
						
					
					
						commit
						a998b3856b
					
				@ -1,13 +1,15 @@
 | 
			
		||||
//! Scheduling for events to run at certain intervals in the future
 | 
			
		||||
 | 
			
		||||
use chrono::{
 | 
			
		||||
    Date, DateTime, Datelike, Duration as CDuration, Local, NaiveDateTime, NaiveTime, TimeZone,
 | 
			
		||||
    Date, DateTime, Datelike, Local, NaiveDateTime, NaiveTime, TimeZone,
 | 
			
		||||
    Weekday,
 | 
			
		||||
};
 | 
			
		||||
use serde::{Deserialize, Serialize};
 | 
			
		||||
use std::cmp;
 | 
			
		||||
use std::iter::FromIterator;
 | 
			
		||||
 | 
			
		||||
pub use chrono::Duration;
 | 
			
		||||
 | 
			
		||||
/// A set of times of day (for [Schedule](struct.Schedule.html))
 | 
			
		||||
pub type TimeSet = Vec<NaiveTime>;
 | 
			
		||||
/// A set of days of week (for [Schedule](struct.Schedule.html))
 | 
			
		||||
@ -380,7 +382,7 @@ impl Schedule {
 | 
			
		||||
                    .and_time(*time)
 | 
			
		||||
                    .map(|date| {
 | 
			
		||||
                        if date < reference {
 | 
			
		||||
                            date + CDuration::weeks(1)
 | 
			
		||||
                            date + Duration::weeks(1)
 | 
			
		||||
                        } else {
 | 
			
		||||
                            date
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user