Skip to content
Snippets Groups Projects
Commit e1a1d576 authored by Gael Grosch's avatar Gael Grosch
Browse files

Truncate should happen even if value of unit is 0

parent 181cfdf3
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,7 @@
DateTimeField (->rvalue [this] (->rvalue (:field this)))
Value (->rvalue [this] (:value this))
DateTimeValue (->rvalue [{{unit :unit} :field, value :value}] (u/date->iso-8601 (u/date-trunc-or-extract unit value)))
RelativeDateTimeValue (->rvalue [{:keys [unit amount]}] (if (zero? amount)
(u/date->iso-8601)
(u/date->iso-8601 (u/date-trunc-or-extract unit (u/relative-date unit amount))))))
RelativeDateTimeValue (->rvalue [{:keys [unit amount]}] (u/date->iso-8601 (u/date-trunc-or-extract unit (u/relative-date unit amount)))))
(defprotocol ^:private IDimensionOrMetric
(^:private dimension-or-metric? [this]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment