def extract_datetime_query(prefix)
      query = {}
      {:from => :gte, :to => :lte, :gt => nil, :lt => nil, :gte => nil, :lte => nil}.each do |key, as|
        k = "#{prefix}.#{key}"
        if params.has_key?(k)
          query[as || key] = fuzzy_parse(params[k]) or raise Garage::BadRequest, "Can't parse datetime #{params[k]}"
        end
      end
      query if query.size > 0
    end
def extract_datetime_query(prefix)
      query = {}
      {:from => :gte, :to => :lte, :gt => nil, :lt => nil, :gte => nil, :lte => nil}.each do |key, as|
        k = "#{prefix}.#{key}"
        if params.has_key?(k)
          query[as || key] = fuzzy_parse(params[k]) or raise Garage::BadRequest, "Can't parse datetime #{params[k]}"
        end
      end
      query if query.size > 0
    end
Private: extract date time range query from query parameters
 Treat `from` and `to` as aliases for `gte` and `lte` respectively