Skip to content

Commit e4c55c9

Browse files
Revert "small fix and add tests"
This reverts commit fa0259c.
1 parent 42996e4 commit e4c55c9

10 files changed

Lines changed: 3 additions & 863 deletions

File tree

packages/devextreme/js/__internal/core/localization/date.global_formats.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ const saveAndRestore = (): { save: () => void; restore: () => void } => {
2626
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
2727
delete currentConfig[key];
2828
} else {
29-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
30-
(currentConfig as any)[key] = savedValues[key];
29+
currentConfig[key] = savedValues[key];
3130
}
3231
});
3332
},
@@ -188,10 +187,7 @@ describe('date localization - dateTimeFormatPresets', () => {
188187
},
189188
});
190189

191-
const customFormatter = (value: number | Date): string => {
192-
const d = value instanceof Date ? value : new Date(value);
193-
return `custom:${d.getFullYear()}`;
194-
};
190+
const customFormatter = (d: Date): string => `custom:${d.getFullYear()}`;
195191
const result = dateLocalization.format(new Date(2020, 0, 2), { formatter: customFormatter });
196192

197193
expect(result).toBe('custom:2020');

packages/devextreme/js/__internal/core/m_config.test.ts

Lines changed: 0 additions & 127 deletions
This file was deleted.

packages/devextreme/js/__internal/core/m_config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ const configMethod = (...args) => {
8383
});
8484

8585
extend(config, newConfig);
86-
const formatKeys = ['dateFormat', 'timeFormat', 'dateTimeFormat', 'numberFormat', 'dateTimeFormatPresets'] as const;
87-
for (const key of formatKeys) {
88-
if (key in newConfig && newConfig[key] === undefined) {
89-
config[key] = undefined;
90-
}
91-
}
9286
};
9387

9488
// @ts-expect-error typescript cant see global

packages/devextreme/js/__internal/core/m_global_format_config.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ describe('m_global_format_config', () => {
2727
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
2828
delete currentConfig[key];
2929
} else {
30-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
31-
(currentConfig as any)[key] = savedValues[key];
30+
currentConfig[key] = savedValues[key];
3231
}
3332
});
3433
});

packages/devextreme/js/__internal/filter_builder/__tests__/utils.global_format.test.ts

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/devextreme/js/__internal/grids/pivot_grid/__tests__/m_widget_utils.global_format.test.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)