I have a column that displays date strings such as "04/28/2017 3:00 PM". The data for this column are actually integers (epoch) such as "1493411432". jqGrid allows me to define a formatter to generate the date strings from epoch values for display in the grid column. The problem is that if a user wants to specify in the search dialog something like "End Time greater than "04/28/2017 3:00 PM"", it won't work because "04/28/2017 3:00 PM" will be compared with the interval epoch values. Does jqGrid provide any hook such that I can convert the date string to its corresponding epoch value which can then be used by jqGrid to do the search? Any other suggestions will also be appreciated.
Asked
Active
Viewed 91 times
1 Answers
0
If I examine Date(1493411432)
the Apr 28 2017 23:03:32 GMT+0200
. If you want to allow the user to filter (to search) for such dates then you should solve one more problem: to filter for date ignoring the time (or at least seconds or other minor parts of the time).
Relatively simple and flexible solution of the problem exist in free jqGrid fork of jqGrid, which I develop. It provides custom filtering feature, which get you full control to define custom searching/filtering operation and to define how it should be implemented.
Try the demo, which I created for the answer. You can filter for 4/15/2015
. I think that it's very close to what you need and you can easy modify the code corresponded your requirements.