Skip to content

Commit d8c8f3d

Browse files
authored
Scheduler: use timezones second parameter in demo
1 parent 71d43b0 commit d8c8f3d

File tree

5 files changed

+5
-18
lines changed

5 files changed

+5
-18
lines changed

apps/demos/Demos/Scheduler/TimeZonesSupport/Angular/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class AppComponent {
4444
this.currentTimeZone = this.timeZones[0].id;
4545
}
4646

47-
getDefaultTimeZones = (date: Date) => getTimeZones(date).filter((timeZone) => this.service.getLocations().indexOf(timeZone.id) !== -1);
47+
getDefaultTimeZones = (date: Date) => getTimeZones(date, this.service.getLocations())
4848

4949
onAppointmentFormOpening({ form }: DxSchedulerTypes.AppointmentFormOpeningEvent) {
5050
const startDateDataSource = form.getEditor('startDateTimeZone').option('dataSource') as DataSource;

apps/demos/Demos/Scheduler/TimeZonesSupport/React/App.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ const timeZoneLabel = { 'aria-label': 'Time zone' };
1010
const currentDate = new Date(2021, 3, 27);
1111
const views: SchedulerTypes.ViewType[] = ['workWeek'];
1212

13-
const getTimeZones = (date: Date) => {
14-
const timeZones = timeZoneUtils.getTimeZones(date);
15-
16-
return timeZones.filter((timeZone: { id: string; }) => locations.indexOf(timeZone.id) !== -1);
17-
};
13+
const getTimeZones = (date) => timeZoneUtils.getTimeZones(date, locations)
1814

1915
const defaultTimeZones = getTimeZones(currentDate);
2016

apps/demos/Demos/Scheduler/TimeZonesSupport/ReactJs/App.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import { data, locations } from './data.js';
77
const timeZoneLabel = { 'aria-label': 'Time zone' };
88
const currentDate = new Date(2021, 3, 27);
99
const views = ['workWeek'];
10-
const getTimeZones = (date) => {
11-
const timeZones = timeZoneUtils.getTimeZones(date);
12-
return timeZones.filter((timeZone) => locations.indexOf(timeZone.id) !== -1);
13-
};
10+
const getTimeZones = (date) => timeZoneUtils.getTimeZones(date, locations);
1411
const defaultTimeZones = getTimeZones(currentDate);
1512
const onAppointmentFormOpening = (e) => {
1613
const { form } = e;

apps/demos/Demos/Scheduler/TimeZonesSupport/Vue/App.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ const views = ['workWeek'];
4040
const dataSource = data;
4141
const currentDate = new Date(2021, 3, 27);
4242
43-
const getTimeZones = function(date: Date) {
44-
const timeZones = getTimeZonesUtility(date);
45-
return timeZones.filter((timeZone) => locations.indexOf(timeZone.id) !== -1);
46-
};
43+
const getTimeZones = (date: Date) => getTimeZonesUtility(date, locations)
4744
4845
const timeZones = ref(getTimeZones(currentDate));
4946
const currentTimeZone = ref(timeZones.value[0].id);

apps/demos/Demos/Scheduler/TimeZonesSupport/jQuery/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
$(() => {
22
const currentDate = new Date(2021, 3, 27);
33

4-
const getTimeZones = function (date) {
5-
const timeZones = DevExpress.utils.getTimeZones(date);
6-
return timeZones.filter((timeZone) => locations.indexOf(timeZone.id) !== -1);
7-
};
4+
const getTimeZones = (date) => DevExpress.utils.getTimeZones(date, locations)
85

96
const timeZones = getTimeZones(currentDate);
107

0 commit comments

Comments
 (0)