Skip to content

Commit 34e7eff

Browse files
committed
fix
1 parent 6862a1f commit 34e7eff

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ const E2E_TEST_CLASSES = {
3939
recurrenceSwitch: 'e2e-dx-scheduler-form-recurrence-switch',
4040
};
4141

42-
const DEFAULT_TIMEZONE_EDITOR_DATA_SOURCE_OPTIONS = {
42+
const createTimeZoneDataSource = () => new DataSource({
43+
store: timeZoneUtils.getTimeZonesCache(),
4344
paginate: true,
4445
pageSize: 10,
45-
};
46+
});
4647

4748
const getStylingModeFunc = (): string | undefined => (isFluent(current()) ? 'filled' : undefined);
4849

@@ -191,6 +192,7 @@ export class AppointmentForm {
191192
valueExpr: 'id',
192193
placeholder: noTzTitle,
193194
searchEnabled: true,
195+
dataSource: createTimeZoneDataSource(),
194196
onValueChanged: (args) => {
195197
const { form } = this;
196198
const secondTimezoneEditor = form.getEditor(secondTimeZoneExpr);
@@ -426,16 +428,6 @@ export class AppointmentForm {
426428
editor && this.form.itemOption(editorPath, 'editorOptions', extend({}, editor.editorOptions, options));
427429
}
428430

429-
private setupTimezoneEditorDataSource(editorName: string): void {
430-
const timezones = timeZoneUtils.getTimeZonesCache();
431-
const dataSource = new DataSource({
432-
...DEFAULT_TIMEZONE_EDITOR_DATA_SOURCE_OPTIONS,
433-
store: timezones,
434-
});
435-
436-
this.setEditorOptions(editorName, 'Main', { dataSource });
437-
}
438-
439431
updateFormData(formData: Record<string, any>): void {
440432
this.isFormUpdating = true;
441433
this.form.option('formData', formData);
@@ -448,9 +440,6 @@ export class AppointmentForm {
448440
const allDay = dataAccessors.get('allDay', formData);
449441
const startDate = new Date(rawStartDate);
450442

451-
this.setupTimezoneEditorDataSource(expr.startDateTimeZoneExpr);
452-
this.setupTimezoneEditorDataSource(expr.endDateTimeZoneExpr);
453-
454443
this.updateRecurrenceEditorStartDate(startDate, expr.recurrenceRuleExpr);
455444

456445
this.setEditorsType(allDay);

packages/devextreme/js/common/core/environment.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export type SchedulerTimeZone = {
9292

9393
/**
9494
* @docid utils.getTimeZones
95-
* @publicName getTimeZones(date)
95+
* @publicName getTimeZones(date, timeZones)
9696
* @param1 date:Date|undefined
97-
* @param2 timeZones:string[]|undefined
97+
* @param2 timeZones:Array<string>|undefined
9898
* @namespace DevExpress.common.core.environment
9999
* @static
100100
* @public

packages/devextreme/ts/dx.all.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,7 @@ declare module DevExpress.common.core.environment {
26522652
*/
26532653
export const devices: DevExpress.core.DevicesObject;
26542654
/**
2655-
* [descr:utils.getTimeZones(date)]
2655+
* [descr:utils.getTimeZones(date, timeZones)]
26562656
*/
26572657
export function getTimeZones(
26582658
date?: Date,

0 commit comments

Comments
 (0)