Merge branch '17756-dispatch-lsf' into main
[arvados.git] / services / api / config / initializers / time_format.rb
index ca67b19ce2519c14113437a3ddac67464033541e..78cabc87ac7cd5f66a07becb1207be53ff6e2af3 100644 (file)
@@ -1,5 +1,19 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+ActiveSupport::JSON::Encoding.time_precision = 9
+
 class ActiveSupport::TimeWithZone
-  def as_json
+  remove_method :as_json
+  def as_json *args
+    strftime "%Y-%m-%dT%H:%M:%S.%NZ"
+  end
+end
+
+class Time
+  remove_method :as_json
+  def as_json *args
     strftime "%Y-%m-%dT%H:%M:%S.%NZ"
   end
 end