Skip to content
Snippets Groups Projects
Commit e855a0fd authored by Callum Herries's avatar Callum Herries
Browse files

Change feature flag to date-arithmetics

parent dfa55039
Branches
Tags
No related merge requests found
......@@ -730,7 +730,7 @@
amount NumericExpressionArg
unit ArithmeticDateTimeUnit)
(defclause ^{:requires-features #{:now}} now)
(defclause ^{:requires-features #{:date-arithmetics}} now)
(defclause ^{:requires-features #{:date-arithmetics}} datetime-subtract
datetime DateTimeExpressionArg
......
......@@ -300,7 +300,7 @@
(t/after? (t/instant t1) (t/minus (t/instant t2) period))))
(deftest now-test
(mt/test-drivers (mt/normal-drivers-with-feature :now)
(mt/test-drivers (mt/normal-drivers-with-feature :date-arithmetics)
(testing "should return the current time"
;; Allow a 30 second window for the current time to account for any difference between the time in Clojure and the DB
(is (= true
......@@ -328,8 +328,7 @@
(is (= true
(if (:effective_type col)
(isa? (:effective_type col) :type/DateTime)
(isa? (:base_type col) :type/DateTime)))))))
(mt/test-drivers (mt/normal-drivers-with-feature :now :date-arithmetics)
(isa? (:base_type col) :type/DateTime))))))
(testing "should work as an argument to datetime-add and datetime-subtract"
(is (= true
(-> (mt/run-mbql-query venues
......@@ -340,7 +339,7 @@
ffirst
u.date/parse
(close? (t/instant) (t/seconds 30)))))))
(mt/test-drivers (mt/normal-drivers-with-feature :now :datetime-diff)
(mt/test-drivers (mt/normal-drivers-with-feature :date-arithmetics :datetime-diff)
(testing "should work as an argument to datetime-diff"
(is (= [1 1]
(-> (mt/run-mbql-query venues
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment