lib/base/query_builder.rb in logworm-0.7.5 vs lib/base/query_builder.rb in logworm-0.7.6
- old
+ new
@@ -68,10 +68,12 @@
###
# Timeframe: String
###
@tf = {}
@tf[:start] = unquote(@options[:start]).to_s if is_set?(@options[:start]) or is_set?(@options[:start], Integer, 0)
- @tf[:end] = unquote(@options[:end]).to_s if is_set?(@options[:end]) or is_set?(@options[:end], Integer, 0)
+ @tf[:start] = unquote(@options[:start].strftime("%Y-%m-%dT%H:%M:%SZ")).to_s if is_set?(@options[:start], Time)
+ @tf[:end] = unquote(@options[:end]).to_s if is_set?(@options[:end]) or is_set?(@options[:end], Integer, 0)
+ @tf[:end] = unquote(@options[:end].strftime("%Y-%m-%dT%H:%M:%SZ")).to_s if is_set?(@options[:end], Time)
query_opts << '"timeframe":' + @tf.to_json if @tf.keys.size > 0
###
# Limit
# String or Integer
\ No newline at end of file