|
| 1 | +import $ from 'jquery'; |
| 2 | +import Scheduler from '../js/__internal/scheduler/m_scheduler'; |
| 3 | +import 'devextreme/dist/css/dx.light.css'; |
| 4 | + |
| 5 | +const dataSource = [ |
| 6 | + { |
| 7 | + text: "Meeting with John", |
| 8 | + startDate: new Date(2024, 0, 10, 9, 0), |
| 9 | + endDate: new Date(2024, 0, 10, 10, 30), |
| 10 | + allDay: false |
| 11 | + }, |
| 12 | + { |
| 13 | + text: "Conference Call", |
| 14 | + startDate: new Date(2024, 0, 10, 14, 0), |
| 15 | + endDate: new Date(2024, 0, 10, 15, 0), |
| 16 | + allDay: false |
| 17 | + }, |
| 18 | + { |
| 19 | + text: "Team Building Event", |
| 20 | + startDate: new Date(2024, 0, 11, 10, 0), |
| 21 | + endDate: new Date(2024, 0, 11, 17, 0), |
| 22 | + allDay: false |
| 23 | + } |
| 24 | +]; |
| 25 | + |
| 26 | +$(document).ready(() => { |
| 27 | + new (Scheduler as any)($('#container'), { |
| 28 | + dataSource, |
| 29 | + views: ['day', 'week', 'workWeek', 'month'], |
| 30 | + currentView: 'week', |
| 31 | + currentDate: new Date(2024, 0, 10), |
| 32 | + startDayHour: 8, |
| 33 | + endDayHour: 18, |
| 34 | + height: 600, |
| 35 | + editing: { |
| 36 | + allowAdding: true, |
| 37 | + allowDeleting: true, |
| 38 | + allowUpdating: true, |
| 39 | + allowResizing: true, |
| 40 | + allowDragging: true |
| 41 | + }, |
| 42 | + onAppointmentAdded: (e) => { |
| 43 | + console.log('Appointment added:', e.appointmentData); |
| 44 | + }, |
| 45 | + onAppointmentUpdated: (e) => { |
| 46 | + console.log('Appointment updated:', e.appointmentData); |
| 47 | + }, |
| 48 | + onAppointmentDeleted: (e) => { |
| 49 | + console.log('Appointment deleted:', e.appointmentData); |
| 50 | + } |
| 51 | + }); |
| 52 | + |
| 53 | + console.log('Scheduler initialized with HMR support'); |
| 54 | +}); |
0 commit comments