remove timezone offset from feeds calculations
This commit is contained in:
		@@ -103,9 +103,7 @@ module FeedHelper
 | 
				
			|||||||
  # get the time floored to the correct number of seconds
 | 
					  # get the time floored to the correct number of seconds
 | 
				
			||||||
  def get_floored_time(input_time, seconds)
 | 
					  def get_floored_time(input_time, seconds)
 | 
				
			||||||
    floored_seconds = (input_time.to_f / seconds).floor * seconds
 | 
					    floored_seconds = (input_time.to_f / seconds).floor * seconds
 | 
				
			||||||
    # offset the seconds by the current time zone offset
 | 
					    return Time.at(floored_seconds)
 | 
				
			||||||
    offset_seconds = Time.zone.now.utc_offset
 | 
					 | 
				
			||||||
    return Time.at(floored_seconds - offset_seconds)
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # slice feed into timescales
 | 
					  # slice feed into timescales
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ class FeedFactory < ApplicationController
 | 
				
			|||||||
  # calculate the limit that should be used
 | 
					  # calculate the limit that should be used
 | 
				
			||||||
  def calculate_limit
 | 
					  def calculate_limit
 | 
				
			||||||
    limit = 100
 | 
					    limit = 100
 | 
				
			||||||
    limit = 8000 if @options[:results].present? || @options[:days].present? || @options[:start].present? || @options[:end].present?
 | 
					    limit = 8000 if @options[:results].present? || @options[:days].present? || @options[:start].present? || @options[:end].present? || @options[:start_entry_id] || @options[:end_entry_id]
 | 
				
			||||||
    limit = @options[:results].to_i if (@options[:results].present? && @options[:results].to_i < 8000)
 | 
					    limit = @options[:results].to_i if (@options[:results].present? && @options[:results].to_i < 8000)
 | 
				
			||||||
    return limit
 | 
					    return limit
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user