summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-22 15:36:15 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-22 15:36:15 +0200
commit135cb8b82fd41460dea0eb3695cd9f1c805ca1a6 (patch)
tree0e64fcf94ab04b3976ec6a7eda92ee9454b2ede3
parentbb33b92fad33d319544ddf676b4c13a67e04acdc (diff)
xapian: Support hour search.
-rw-r--r--mumi/xapian.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/mumi/xapian.scm b/mumi/xapian.scm
index debee37..8546e78 100644
--- a/mumi/xapian.scm
+++ b/mumi/xapian.scm
@@ -137,6 +137,8 @@ messages and index their contents in the Xapian database at DBPATH."
(define (sanitize-date-range token)
(define now (current-time))
+ (define (hours n)
+ (make-time time-duration 0 (* 60 60 n)))
(define (days n)
(make-time time-duration 0 (* 60 60 24 n)))
(define (range-boundary->date-string boundary*)
@@ -159,6 +161,8 @@ messages and index their contents in the Xapian database at DBPATH."
(subtract-duration
now
(match unit
+ ((or "h" "hour" "hours")
+ (hours n))
((or "d" "day" "days")
(days n))
((or "w" "week" "weeks")