Unplanned
Last Updated: 18 Oct 2023 12:48 by ADMIN
Hui Chuan
Created on: 11 Oct 2023 05:19
Category: Kendo UI for Angular
Type: Feature Request
0
toDataSourceRequest() needs an option to preserve UTC offset

Current behavior

Currently when calling toDataSourceRequest with a date filter, the following is observed:

  1. Set a filter with the Date object of Wed Sep 19 2018 00:00:00 GMT+0530 (India Standard Time)
  2. Call toDataSourceRequest or toDataSourceRequestString with the grid state
  3. The resulting query string contains datetime'2018-09-19T00-00-00'
  4. 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:

  1. Set a filter with the Date object of Wed Sep 19 2018 00:00:00 GMT+0530 (India Standard Time)
  2. The resulting query string contains datetime'2018-09-18T18-30-00' (append Z if possible)
  3. On the backend, MVC can bind the DataSourceRequest with DateTime of {2018/9/18 18:30:00} and an offset of 0
2 comments
ADMIN
Yanmario
Posted on: 18 Oct 2023 12:48

Hi Hui,

The feature request is valid and I will update the status to "Unplanned". Our developers will keep track of the request and update it when it is considered for implementation.

Have a wonderful day.

Regards,
Yanmario
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
ADMIN
Yanmario
Posted on: 17 Oct 2023 14:12

Hi Hui,

Thank you for the provided feedback.

I will have to confer with our developers about the feature request, and I will keep you posted on their decision.

Regards,
Yanmario
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources