Your search did not match any results.
Scheduler

Time Zones Support

Documentation

The Scheduler widget can show appointments in different time zones. The current time zone is specified using the timeZome option is utilized. In this demo, you can change the time zone of an appointment in the appointment details form. To make the time zone selectors visible, the onAppointmentFormOpening is utilized.

Copy to CodeSandBox
Apply
Reset
import React from 'react'; import Scheduler, { Resource } from 'devextreme-react/scheduler'; import SelectBox from 'devextreme-react/select-box'; import DataSource from 'devextreme/data/data_source'; import { data, locations } from './data.js'; const currentDate = new Date(2017, 4, 25); const views = ['workWeek']; const dataSource = new DataSource({ store: data, filter: ['startDateTimeZone', locations[0].value] }); class App extends React.Component { constructor(props) { super(props); this.state = { timeZone: locations[0].value }; this.onLocationChanged = this.onLocationChanged.bind(this); this.onAppointmentFormOpening = this.onAppointmentFormOpening.bind(this); } render() { return ( <React.Fragment> <Scheduler dataSource={dataSource} views={views} defaultCurrentView={'workWeek'} defaultCurrentDate={currentDate} startDayHour={8} height={600} timeZone={this.state.timeZone} onAppointmentFormOpening={this.onAppointmentFormOpening} > <Resource fieldExpr={'startDateTimeZone'} valueExpr={'value'} dataSource={locations} /> </Scheduler> <div className={'options'}> <div className={'caption'}>Options</div> <div className={'option'}> <span>Office Location </span> <SelectBox items={locations} width={200} defaultValue={locations[0].value} displayExpr={'text'} valueExpr={'value'} onValueChanged={this.onLocationChanged} /> </div> </div> </React.Fragment> ); } onLocationChanged(e) { dataSource.filter(['startDateTimeZone', e.value]); dataSource.load(); this.setState({ timeZone: e.value }); } onAppointmentFormOpening(e) { e.form.itemOption('startDateTimeZone', { visible: true }); e.form.itemOption('endDateTimeZone', { visible: true }); } } export default App;
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.js'; ReactDOM.render( <App />, document.getElementById('app') );
<!DOCTYPE html> <html> <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/19.1.3/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/19.1.3/css/dx.light.css" /> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/systemjs@0.21.3/dist/system.js"></script> <script type="text/javascript" src="config.js"></script> <script type="text/javascript"> System.import('./index.js'); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"></div> </div> </body> </html>
.options { padding: 20px; background-color: rgba(191, 191, 191, 0.15); margin-top: 20px; } .caption { font-size: 18px; font-weight: 500; } .option { margin-top: 10px; } .option > span { position: relative; top: 2px; margin-right: 10px; } .option > .dx-selectbox { display: inline-block; vertical-align: middle; }
export const data = [{ text: 'Stand-up meeting', startDate: '2017-05-22T15:30:00.000Z', endDate: '2017-05-22T15:45:00.000Z', recurrenceRule: 'FREQ=DAILY', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'Website Re-Design Plan', startDate: '2017-05-23T16:30:00.000Z', endDate: '2017-05-23T18:30:00.000Z', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'Book Flights to San Fran for Sales Trip', startDate: '2017-05-24T18:00:00.000Z', endDate: '2017-05-24T19:00:00.000Z', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'Install New Router in Dev Room', startDate: '2017-05-25T17:00:00.000Z', endDate: '2017-05-25T21:30:00.000Z', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'Approve Personal Computer Upgrade Plan', startDate: '2017-05-26T16:00:00.000Z', endDate: '2017-05-26T17:00:00.000Z', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'New Brochures', startDate: '2017-05-26T19:30:00.000Z', endDate: '2017-05-26T20:45:00.000Z', startDateTimeZone: 'America/Los_Angeles', endDateTimeZone: 'America/Los_Angeles' }, { text: 'Daily meeting', startDate: '2017-05-22T12:30:00.000Z', endDate: '2017-05-22T12:45:00.000Z', recurrenceRule: 'FREQ=DAILY', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Website Re-Design Plan', startDate: '2017-05-23T13:30:00.000Z', endDate: '2017-05-23T14:30:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Book Flights to San Fran for Sales Trip', startDate: '2017-05-24T14:00:00.000Z', endDate: '2017-05-24T15:00:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Install New Router in Dev Room', startDate: '2017-05-25T14:30:00.000Z', endDate: '2017-05-25T17:30:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Approve Personal Computer Upgrade Plan', startDate: '2017-05-23T15:00:00.000Z', endDate: '2017-05-23T16:00:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'New Brochures', startDate: '2017-05-26T13:30:00.000Z', endDate: '2017-05-26T14:45:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Upgrade Personal Computers', startDate: '2017-05-26T15:15:00.000Z', endDate: '2017-05-26T16:30:00.000Z', startDateTimeZone: 'America/New_York', endDateTimeZone: 'America/New_York' }, { text: 'Prepare 2017 Marketing Plan', startDate: '2017-05-22T07:00:00.000Z', endDate: '2017-05-22T09:30:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }, { text: 'Launch New Website', startDate: '2017-05-24T08:00:00.000Z', endDate: '2017-05-24T10:00:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }, { text: 'Submit New Website Design', startDate: '2017-05-25T09:30:00.000Z', endDate: '2017-05-25T11:00:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }, { text: 'Upgrade Server Hardware', startDate: '2017-05-26T06:30:00.000Z', endDate: '2017-05-26T08:00:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }, { text: 'Approve New Online Marketing Strategy', startDate: '2017-05-26T11:00:00.000Z', endDate: '2017-05-26T12:30:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }, { text: 'Final Budget Review', startDate: '2017-05-23T09:00:00.000Z', endDate: '2017-05-23T10:35:00.000Z', startDateTimeZone: 'Europe/Berlin', endDateTimeZone: 'Europe/Berlin' }]; export const locations = [{ value: 'America/Los_Angeles', text: 'Los Angeles', color: '#1e90ff' }, { value: 'America/New_York', text: 'New York', color: '#56ca85' }, { value: 'Europe/Berlin', text: 'Berlin', color: '#ff9747' }];
System.config({ transpiler: 'plugin-babel', paths: { 'npm:': 'https://unpkg.com/' }, defaultExtension: 'js', map: { 'react': 'npm:react@16/umd/react.development.js', 'react-dom': 'npm:react-dom@16/umd/react-dom.development.js', 'prop-types': 'npm:prop-types/prop-types.js', 'devextreme': 'npm:devextreme@19.1', 'devextreme-react': 'npm:devextreme-react@19.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.6/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram', // SystemJS plugins 'plugin-babel': 'npm:systemjs-plugin-babel@0/plugin-babel.js', 'systemjs-babel-build': 'npm:systemjs-plugin-babel@0/systemjs-babel-browser.js' }, packages: { 'devextreme': { defaultExtension: 'js' }, 'devextreme-react': { main: 'index.js' } }, babelOptions: { sourceMaps: false, stage0: true, react: true } });