Current behavior
Currently when calling toDataSourceRequest with a date filter, the following is observed:
- Set a filter with the Date object of Wed Sep 19 2018 00:00:00 GMT+0530 (India Standard Time)
- Call toDataSourceRequest or toDataSourceRequestString with the grid state
- The resulting query string contains datetime'2018-09-19T00-00-00'
- On the backend, MVC can bind the DataSourceRequest with DateTime of {2018/9/19 00:00:00} and an offset of ???
As you can see, the browser's UTC offset is discarded when constructing the query. This presents an issue when the backend server is running in a time zone that is different than the browser or is invariant. Internally toDataSourceRequest calls formatDateValue which calls toUTC. I propose adding an optional argument that allows us to skip this operation so that the offset can be kept as is, the reason being so that it can later be normalized to UTC without losing the information.
Expected behavior
Calling toDataSourceRequest with the option should produce the following:
- Set a filter with the Date object of Wed Sep 19 2018 00:00:00 GMT+0530 (India Standard Time)
- The resulting query string contains datetime'2018-09-18T18-30-00' (append Z if possible)
- On the backend, MVC can bind the DataSourceRequest with DateTime of {2018/9/18 18:30:00} and an offset of 0