0

The time zone is set to GMT +1100 through

config.time_zone = 'Australia/Sydney'  

The date helper is set to calender by

Wice::Defaults::HELPER_STYLE = :calendar

When I filter a datetime field 'created_at' by input the start date to '2014-10-21' and end date to '2014-10-21', the expected query should be

where created_at >= '2014-10-20 13:00:00' and created_at < '2014-10-21 13:00:00'

but actually the generated sql is

where created_at >= '2014-10-21' and created_at < '2014-10-22'

After I look into the source code, I find the following code in line 112 in file 'lib/wice/columns/column_datetime.rb'

conditions << opts[:fr].to_date

If I remove the 'to_date', the query will be generated correctly.

What's the purpose of this 'to_date' conversion and how can i fix this ?

fibers
  • 16
  • 2

1 Answers1

0

Any comments ? I have no idea on this for a long time.

fibers
  • 16
  • 2