Fixed postgresql ERROR: date/time field value out of range: "2016-6-31" issue.
This commit is contained in:
parent
94148b37aa
commit
2137250bae
2 changed files with 6 additions and 5 deletions
|
@ -159,9 +159,10 @@ class ReportsController < ApplicationController
|
||||||
stop = Date.parse(start).end_of_month
|
stop = Date.parse(start).end_of_month
|
||||||
range = 'day'
|
range = 'day'
|
||||||
else
|
else
|
||||||
start = "#{params[:year]}-01-01"
|
start = "#{params[:year]}-01-01"
|
||||||
stop = "#{params[:year]}-12-31"
|
stop_date = Date.parse(day_start).end_of_month
|
||||||
range = 'month'
|
stop = "#{stop_date.year}-#{stop_date.month}-#{stop_date.day}"
|
||||||
|
range = 'month'
|
||||||
end
|
end
|
||||||
{
|
{
|
||||||
profile: profile,
|
profile: profile,
|
||||||
|
|
|
@ -56,8 +56,8 @@ returns
|
||||||
stop = start + 1.minute
|
stop = start + 1.minute
|
||||||
end
|
end
|
||||||
query, bind_params, tables = Ticket.selector2sql(params[:selector])
|
query, bind_params, tables = Ticket.selector2sql(params[:selector])
|
||||||
sender = Ticket::Article::Sender.lookup( name: params[:params][:sender] )
|
sender = Ticket::Article::Sender.lookup(name: params[:params][:sender])
|
||||||
type = Ticket::Article::Type.lookup( name: params[:params][:type] )
|
type = Ticket::Article::Type.lookup(name: params[:params][:type])
|
||||||
count = Ticket::Article.joins('INNER JOIN tickets ON tickets.id = ticket_articles.ticket_id')
|
count = Ticket::Article.joins('INNER JOIN tickets ON tickets.id = ticket_articles.ticket_id')
|
||||||
.where(query, *bind_params).joins(tables)
|
.where(query, *bind_params).joins(tables)
|
||||||
.where(
|
.where(
|
||||||
|
|
Loading…
Reference in a new issue