Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Bug fix: finest grain not used in interval #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/duckling/time/obj.clj
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@
The grain is the smallest of the args."
[t1 t2]
{:pre [(valid? t1) (valid? t2)]}
{:start (:start t1)
:grain (max-key grain-order (:grain t1) (:grain t2))
:end (end t2)})
(let [grain (max-key grain-order (:grain t1) (:grain t2))]
{:start (:start (assoc t1 :grain grain))
:grain grain
:end (end (assoc t2 :grain grain))}))

(defn intersect
"With the special case of time grains, it's quite easy. Will need to generalize to
Expand Down