Commit c70ebb73469ea82f5b50e7295287fae1c7aedd22
1 parent
afb42823
Exists in
master
and in
1 other branch
fix time-zone dependant spec failure
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/controllers/api/v1/notices_controller.rb
| @@ -6,8 +6,8 @@ class Api::V1::NoticesController < ApplicationController | @@ -6,8 +6,8 @@ class Api::V1::NoticesController < ApplicationController | ||
| 6 | fields = %w{created_at message error_class} | 6 | fields = %w{created_at message error_class} |
| 7 | 7 | ||
| 8 | if params.key?(:start_date) && params.key?(:end_date) | 8 | if params.key?(:start_date) && params.key?(:end_date) |
| 9 | - start_date = Time.parse(params[:start_date]).utc | ||
| 10 | - end_date = Time.parse(params[:end_date]).utc | 9 | + start_date = Time.zone.parse(params[:start_date]).utc |
| 10 | + end_date = Time.zone.parse(params[:end_date]).utc | ||
| 11 | query = {:created_at => {"$lte" => end_date, "$gte" => start_date}} | 11 | query = {:created_at => {"$lte" => end_date, "$gte" => start_date}} |
| 12 | end | 12 | end |
| 13 | 13 |