Skip to content

Commit 87cf02b

Browse files
Change OData store default value of deserializeDates + rename option
1 parent 2ba223c commit 87cf02b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/devextreme/js/__internal/data/odata/m_query_adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const createODataQueryAdapter = (queryOptions) => {
277277
jsonp: queryOptions.jsonp,
278278
withCredentials: queryOptions.withCredentials,
279279
countOnly: _countQuery,
280-
deserializeDates: queryOptions.deserializeDates,
280+
processDatesAsUtc: queryOptions.processDatesAsUtc,
281281
fieldTypes: queryOptions.fieldTypes,
282282
isPaged: isFinite(_take),
283283
},

packages/devextreme/js/__internal/data/odata/m_request_dispatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class RequestDispatcher {
1818
// @ts-expect-error
1919
this._withCredentials = options.withCredentials;
2020
// @ts-expect-error
21-
this._deserializeDates = options.deserializeDates;
21+
this._processDatesAsUtc = options.processDatesAsUtc ?? options.deserializeDates ?? false;
2222
// @ts-expect-error
2323
this._filterToLower = options.filterToLower;
2424
}
@@ -40,7 +40,7 @@ export default class RequestDispatcher {
4040
// @ts-expect-error
4141
withCredentials: this._withCredentials,
4242
// @ts-expect-error
43-
deserializeDates: this._deserializeDates,
43+
processDatesAsUtc: this._processDatesAsUtc,
4444
},
4545
);
4646
}

packages/devextreme/js/__internal/data/odata/m_store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const ODataStore = Store.inherit({
106106
withCredentials: this._requestDispatcher._withCredentials,
107107
expand: loadOptions?.expand,
108108
requireTotalCount: loadOptions?.requireTotalCount,
109-
deserializeDates: this._requestDispatcher._deserializeDates,
109+
processDatesAsUtc: this._requestDispatcher._processDatesAsUtc,
110110
fieldTypes: this._fieldTypes,
111111
};
112112

packages/devextreme/js/__internal/data/odata/m_utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ const ajaxOptionsForRequest = (protocolVersion, request, options = {}) => {
210210

211211
export const sendRequest = (protocolVersion, request, options) => {
212212
const {
213-
deserializeDates, fieldTypes, countOnly, isPaged,
213+
processDatesAsUtc, fieldTypes, countOnly, isPaged,
214214
} = options;
215215
// @ts-expect-error
216216
const d = new Deferred();
217217
const ajaxOptions = ajaxOptionsForRequest(protocolVersion, request, options);
218218

219219
ajax.sendRequest(ajaxOptions).always((obj, textStatus) => {
220220
const transformOptions = {
221-
deserializeDates,
221+
processDatesAsUtc,
222222
fieldTypes,
223223
};
224224
const tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions);
@@ -387,14 +387,14 @@ const transformTypes = (obj, options = {}) => {
387387
transformTypes(obj[key], options);
388388
} else if (typeof value === 'string') {
389389
// @ts-expect-error
390-
const { fieldTypes, deserializeDates } = options;
390+
const { fieldTypes, processDatesAsUtc } = options;
391391
const canBeGuid = !fieldTypes || fieldTypes[key] !== 'String';
392392

393393
if (canBeGuid && GUID_REGEX.test(value)) {
394394
obj[key] = new Guid(value);
395395
}
396396

397-
if (deserializeDates !== false) {
397+
if (processDatesAsUtc !== false) {
398398
if (VERBOSE_DATE_REGEX.exec(value)) {
399399
// @ts-expect-error
400400
const date = new Date(Number(RegExp.$1) + RegExp.$2 * 60 * 1000);

0 commit comments

Comments
 (0)