This is a migrated thread and some comments may be shown as answers.

[Solved] Grid Filter by DateTime

4 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ng
Top achievements
Rank 1
Ng asked on 29 Jul 2011, 04:27 AM
  • ASP.NET MVC version - ASP.NET MVC 3
  • OS - Windows XP SP3
  • exact browser version - Chrome 12.0.742.122
  • exact version of the Telerik product - Extensions for ASP.NET MVC Q2 2011
  • preferred programming language (VB.NET or C#) - C#

There is a bug in DateTime column filtering. I perform the follow fix in source code.

telerik.grid.js - line 1148
if (typeof filter.value == 'string')
    filter.value = $t.datetime.parse({ value: filter.value, format: format }).toDate();


telerik.grid.filtering.js - line 345
if (typeof value == 'string' && value.indexOf('Date(') > -1)
    date = new Date(parseInt(value.replace(/^\/Date\((.*?)\)\/$/, '$1')));
else
    date = value;

4 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 29 Jul 2011, 06:58 AM
Hello Ng,

 This is a known issue which has been fixed in the latest internal build.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
Don Cote
Top achievements
Rank 1
answered on 08 Feb 2012, 05:07 PM
has this been released yet?
0
Atanas Korchev
Telerik team
answered on 08 Feb 2012, 05:31 PM
Hello,

 Yes the hotfix has been officially released for a few months now.

Kind regards,
Atanas Korchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Don Cote
Top achievements
Rank 1
answered on 08 Feb 2012, 06:36 PM
I was still having issues with filtering by an exact date, since the datetime picker probably used a time of 12:00:00 and the dates in the column have times on them.

I'm using SQL 2008 so I got around it by casting to the "date" type on that end.

Tags
Grid
Asked by
Ng
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Don Cote
Top achievements
Rank 1
Share this question
or