Skip to content

Commit

Permalink
Consider time zones when querying for billing events
Browse files Browse the repository at this point in the history
[fixes #43617383]

Change-Id: Icd8e9a6b14b182ad37fd8222efcb918f16881cf5
  • Loading branch information
Nate Clark committed Feb 1, 2013
1 parent c8b9bdc commit 0cabfa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cloud_controller/api/billing_event.rb
Expand Up @@ -35,7 +35,7 @@ def end_time

def parse_date_param(param)
str = @params[param]
Time.parse(str) if str
Time.parse(str).localtime if str
rescue
raise Errors::BillingEventQueryInvalid
end
Expand Down
4 changes: 2 additions & 2 deletions spec/api/billing_event_spec.rb
Expand Up @@ -82,8 +82,8 @@ module VCAP::CloudController
describe 'GET /v2/billing_events?start_date=#{start_date}&end_date=#{end_date}' do
let(:path) do
"/v2/billing_events?" +
"start_date=#{@start_time.iso8601}" +
"&end_date=#{@end_time.iso8601}"
"start_date=#{@start_time.utc.iso8601}" +
"&end_date=#{@end_time.utc.iso8601}"
end

context "as a cf admin" do
Expand Down

0 comments on commit 0cabfa7

Please sign in to comment.