Your search did not match any results.
Scheduler

Time Zone Support

The Scheduler allows its users to view appointments in different time zones. Set the timeZone option to specify the current time zone. This option accepts values from the IANA time zone database.

In this demo, you can use the drop-down menu above the Scheduler to choose between the Los Angeles, New York, and Berlin time zones. Note that the time zone offset indicated in the drop-down menu may differ from the applied offset due to daylight saving time.

Users can edit the time zones of individual appointments in the appointment details form. To enable this functionality, set the editing.allowTimeZoneEditing option to true. Information about individual time zones is saved in the startDateTimeZone and endDateTimeZone fields of the appointment data objects. However, appointments retain their positions if you change individual time zones, because the timeZone option takes precedence over the start/endDateTimeZone fields. (We plan to reconsider this behavior in upcoming releases.)

Copy to CodeSandBox
Apply
Reset
<div class="option"> <span>Office Time Zone</span> <dx-select-box [items]="locations" [width]="240" displayExpr="text" valueExpr="timeZoneId" [(value)]="timezone" > </dx-select-box> </div> <dx-scheduler [dataSource]="dataSource" [timeZone]="timezone" [views]="['workWeek']" currentView="workWeek" [currentDate]="currentDate" [resources]="resources" [height]="600"> <dxo-editing [allowTimeZoneEditing]="true"> </dxo-editing> </dx-scheduler>
import { NgModule, Component, enableProdMode } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { DxSchedulerModule, DxSelectBoxModule, DxTemplateModule } from 'devextreme-angular'; import { Service, Location, Data } from './app.service'; if(!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: 'app/app.component.html', styleUrls: ['app/app.component.css'], providers: [Service], preserveWhitespaces: true }) export class AppComponent { currentDate: Date = new Date(2017, 4, 25); timezone: string; locations: Location[]; dataSource: Data[]; constructor(service: Service) { this.locations = service.getLocations(); this.dataSource = service.getData(); this.timezone = this.locations[0].timeZoneId; } } @NgModule({ imports: [ BrowserModule, DxSchedulerModule, DxTemplateModule, DxSelectBoxModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule);
::ng-deep .option { display: flex; } ::ng-deep .option > span { display: flex; align-items: center; margin-right: 10px; } ::ng-deep .dx-scheduler { margin-top: 20px; }
import { Injectable } from '@angular/core'; export class Data { text: string; startDate: string; endDate: string; recurrenceRule?: string; } export class Location { timeZoneId: string; text: string; } export const data:Data[] = [{ text: "Stand-up meeting", startDate: "2017-05-22T15:30:00.000Z", endDate: "2017-05-22T15:45:00.000Z", recurrenceRule: "FREQ=DAILY" }, { text: "Book Flights to San Fran for Sales Trip", startDate: "2017-05-24T18:00:00.000Z", endDate: "2017-05-24T19:00:00.000Z" }, { text: "New Brochures", startDate: "2017-05-26T18:30:00.000Z", endDate: "2017-05-26T18:45:00.000Z" }, { text: "Website Re-Design Plan", startDate: "2017-05-23T12:30:00.000Z", endDate: "2017-05-23T13:30:00.000Z" }, { text: "Book Flights to San Fran for Sales Trip", startDate: "2017-05-24T16:00:00.000Z", endDate: "2017-05-24T15:00:00.000Z" }, { text: "Prepare 2017 Marketing Plan", startDate: "2017-05-22T07:00:00.000Z", endDate: "2017-05-22T09:30:00.000Z" }, { text: "Launch New Website", startDate: "2017-05-24T08:00:00.000Z", endDate: "2017-05-24T10:00:00.000Z" }, { text: "Submit New Website Design", startDate: "2017-05-25T09:30:00.000Z", endDate: "2017-05-25T11:00:00.000Z" }, { text: "Upgrade Server Hardware", startDate: "2017-05-26T06:30:00.000Z", endDate: "2017-05-26T08:00:00.000Z" }, { text: "Approve New Online Marketing Strategy", startDate: "2017-05-26T11:00:00.000Z", endDate: "2017-05-26T12:30:00.000Z" }, { text: "Final Budget Review", startDate: "2017-05-23T09:00:00.000Z", endDate: "2017-05-23T10:35:00.000Z" }]; export const locations:Location[] = [{ timeZoneId: "America/Los_Angeles", text: "Los Angeles (UTC-08:00)" }, { timeZoneId: "America/New_York", text: "New York (UTC-05:00)" }, { timeZoneId: "Europe/Berlin", text: "Berlin office (UTC+01:00)" }]; @Injectable() export class Service { getLocations() { return locations; } getData() { return data; } }
// In real applications, you should not transpile code in the browser. You can see how to create your own application with Angular and DevExtreme here: // https://js.devexpress.com/Documentation/Guide/Angular_Components/Getting_Started/Create_a_DevExtreme_Application/ System.config({ transpiler: 'ts', typescriptOptions: { module: "system", emitDecoratorMetadata: true, experimentalDecorators: true }, meta: { 'typescript': { "exports": "ts" }, }, paths: { 'npm:': 'https://unpkg.com/' }, map: { 'ts': 'npm:plugin-typescript@8.0.0/lib/plugin.js', 'typescript': 'npm:typescript@3.4.5/lib/typescript.js', '@angular': 'npm:@angular', 'tslib': 'npm:tslib/tslib.js', 'rxjs': 'npm:rxjs', 'devextreme': 'npm:devextreme@20.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.7/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram@1.0.9', 'devexpress-gantt': 'npm:devexpress-gantt@1.0.7', 'devextreme-angular': 'npm:devextreme-angular@20.1' }, packages: { 'app': { main: './app.component.ts', defaultExtension: 'ts' }, 'devextreme': { defaultExtension: 'js' }, 'devextreme/events/utils': { main: 'index' }, 'devextreme/events': { main: 'index' }, }, packageConfigPaths: [ "npm:*/package.json", "npm:@angular/*/package.json", "npm:@angular/common/*/package.json", "npm:rxjs/operators/package.json", "npm:devextreme-angular@20.1/*/package.json", "npm:devextreme-angular@20.1/ui/*/package.json", ] });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.6/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.6/css/dx.light.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/zone.js@0.10.2/dist/zone.js"></script> <script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script> <script src="https://unpkg.com/systemjs@0.21.3/dist/system.js"></script> <script src="config.js"></script> <script> System.import('app').catch(console.error.bind(console)); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> </body> </html>