Skip to content

Commit 82ff8fb

Browse files
authored
Scheduler: add "Today" button to date editors (#31954)
1 parent 86c66a2 commit 82ff8fb

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Loading

e2e/testcafe-devextreme/tests/scheduler/common/appointmentForm/form.visual.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,39 @@ test.meta({ browserSize: [1500, 1500] })('appointment form resource with multipl
264264
},
265265
});
266266
});
267+
268+
test.meta({ browserSize: [1500, 1500] })('appointment main form with opened startDate calendar', async (t) => {
269+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
270+
271+
const appointment = {
272+
text: 'Appointment',
273+
startDate: new Date('2021-04-26T16:30:00.000Z'),
274+
endDate: new Date('2021-04-26T18:30:00.000Z'),
275+
allDay: false,
276+
};
277+
278+
const scheduler = new Scheduler(SCHEDULER_SELECTOR);
279+
const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, false);
280+
281+
await t.click(appointmentPopup.startDateEditor.dropDownEditorButton);
282+
283+
const calendarPopup = appointmentPopup.startDateEditor.getPopup();
284+
await t.expect(await calendarPopup.isVisible()).ok();
285+
286+
await testScreenshot(
287+
t,
288+
takeScreenshot,
289+
'scheduler__appointment__main-form__startDate-calendar-opened.png',
290+
);
291+
292+
await t
293+
.expect(compareResults.isValid())
294+
.ok(compareResults.errorMessages());
295+
}).before(async () => {
296+
await createWidget('dxScheduler', {
297+
dataSource: [],
298+
views: ['week'],
299+
currentView: 'week',
300+
currentDate: new Date(2021, 2, 25),
301+
});
302+
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const getStartDateCommonConfig = (firstDayOfWeek: string): SimpleItem =>
3030
useMaskBehavior: true,
3131
calendarOptions: {
3232
firstDayOfWeek,
33+
showTodayButton: true,
3334
},
3435
} as unknown as DateBoxProperties,
3536
});

0 commit comments

Comments
 (0)