Skip to content

Instantly share code, notes, and snippets.

@chdsbd
Created September 10, 2018 22:08
Show Gist options
  • Save chdsbd/19557909b3031b176393e74b1dc889c3 to your computer and use it in GitHub Desktop.
Save chdsbd/19557909b3031b176393e74b1dc889c3 to your computer and use it in GitHub Desktop.
diff --git a/src/lib.rs b/src/lib.rs
index 1e3c965..d8b8176 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -120,6 +120,9 @@ mod tests {
assert_eq!(display(parse_date_string("friday 10:30",base,Dialect::Uk)),"2018-03-23T10:30:00+00:00");
assert_eq!(display(parse_date_string("friday 8pm",base,Dialect::Uk)),"2018-03-23T20:00:00+00:00");
+ // Hour of base day.
+ assert_eq!(display(parse_date_string("6:15pm",base,Dialect::Uk)),"2018-03-21T18:15:00+00:00");
+
// The day of week is the _next_ day after today, so "Tuesday" is the next Tuesday after Wednesday
assert_eq!(display(parse_date_string("tues",base,Dialect::Uk)),"2018-03-27T00:00:00+00:00");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment