Skip to content

Commit

Permalink
Extend #112 to support nanoseconds (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
canac authored Dec 26, 2024
1 parent 6267780 commit c9a1230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
Z: TimeZone,
{
pub fn from(before: &DateTime<Z>) -> PrevFromQuery<Z> {
let initial_datetime = if before.timestamp_subsec_millis() > 0 {
let initial_datetime = if before.timestamp_subsec_nanos() > 0 {
before.clone()
} else {
before.clone() - Duration::seconds(1)
Expand Down
2 changes: 1 addition & 1 deletion src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ mod test {
assert!(prev.single().is_some());
assert_eq!(prev, next);

let prev2 = schedule.prev_from(&(next2.unwrap() + Duration::milliseconds(100)));
let prev2 = schedule.prev_from(&(next2.unwrap() + Duration::nanoseconds(100)));
println!("PREV2 FROM for {} {:?}", expression, prev2);
assert!(prev2.single().is_some());
assert_eq!(prev2, next2);
Expand Down

0 comments on commit c9a1230

Please # to comment.