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

Date Filter not working in the "Binding to remote data" Grid example

6 Answers 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SHAWN
Top achievements
Rank 1
SHAWN asked on 08 Feb 2012, 02:17 AM
I cannot get the Date Filter to work in the "Binding to remote data" Grid example:

http://demos.kendoui.com/web/grid/remote-data.html

Demo video here:
http://screencast.com/t/5Yd6xQTw3

6 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 08 Feb 2012, 07:57 AM
Hello,

Have you defined OrderDate type as in the demo as it seems to be working properly on the live demos:
schema: {                               
 model: {                                   
  fields: {       
   OrderDate: { type: "date" }
  }                               
 }                           
}


All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
SHAWN
Top achievements
Rank 1
answered on 08 Feb 2012, 12:36 PM
The demo video that I took, is from the http://demos.kendoui.com/web/grid/remote-data.html page on this site. 
0
Nikolay Rusev
Telerik team
answered on 08 Feb 2012, 02:58 PM
Hello Shawn,

Seems to be working on my end:
http://screencast.com/t/8Pk3Lb2ZwNk

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
SHAWN
Top achievements
Rank 1
answered on 08 Feb 2012, 06:43 PM
it doesn't work for me in IE, FF & Chrome 
http://screencast.com/t/8LlfcwhYK
(updated video includes all 3 browsers and images of the "About" screen for each)


interesting here is a screen print of what fiddler sees
http://screencast.com/t/XKjt5sz5VO

looks like the query is round tripping to the OData service, but no results are found...

I am puzzled....

Now I am even more confused, when I search for 7/4/1996, I get results for 7/3/1996
http://screencast.com/t/xjkV1KEoq8UZ
0
Accepted
Nikolay Rusev
Telerik team
answered on 09 Feb 2012, 10:51 AM
Hello Shawn,

The behavior is due to difference in time zone for both server and client. Hence toDate function in the demo parses the date in local format. The first item in the Grid has server date( you ca inspect the response for this) 07/04/1996, but is formatted and visualized in the column as 07/03/1996.

You can change the implementation of the toDate function such that the date is parsed as UTC dates:
function toDate(value) {
 var date = dateRegExp.exec(value);
 date = new Date(parseInt(date[1]));
 
 return new Date(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate());
}


Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
SHAWN
Top achievements
Rank 1
answered on 13 Feb 2012, 12:51 PM
The revised toDate function worked like a charm, thank you. Perhaps an update to the sample would help others. Additionally it might be good to see date functions added to Kendo.
Tags
Grid
Asked by
SHAWN
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
SHAWN
Top achievements
Rank 1
Share this question
or