Skip to content

Commit 1f9b242

Browse files
authored
Merge pull request #13 from kmkrish001/main
Updated react scheduler sample to latest version.
2 parents 49c4711 + 71d7d75 commit 1f9b242

File tree

9 files changed

+81
-28464
lines changed

9 files changed

+81
-28464
lines changed

package-lock.json

-28,354
This file was deleted.

package.json

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
{
2-
"name": "react-breadcrumb",
2+
"name": "schedule-react",
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@syncfusion/ej2-react-navigations": "^20.1.57",
7-
"@syncfusion/ej2-react-schedule": "^20.1.57",
8-
"@testing-library/jest-dom": "^5.16.4",
9-
"@testing-library/react": "^13.2.0",
6+
"@syncfusion/ej2-react-schedule": "^27.1.53",
7+
"@testing-library/jest-dom": "^5.17.0",
8+
"@testing-library/react": "^13.4.0",
109
"@testing-library/user-event": "^13.5.0",
11-
"@types/jest": "^27.5.1",
12-
"@types/node": "^16.11.36",
13-
"@types/react": "^18.0.9",
14-
"@types/react-dom": "^18.0.5",
15-
"react": "^18.1.0",
16-
"react-dom": "^18.1.0",
10+
"@types/jest": "^27.5.2",
11+
"@types/node": "^16.18.114",
12+
"@types/react": "^18.3.11",
13+
"@types/react-dom": "^18.3.1",
14+
"react": "^18.3.1",
15+
"react-dom": "^18.3.1",
1716
"react-scripts": "5.0.1",
18-
"typescript": "^4.7.2",
17+
"typescript": "^4.9.5",
1918
"web-vitals": "^2.1.4"
2019
},
2120
"scripts": {

public/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
name="description"
1010
content="Web site created using create-react-app"
1111
/>
12-
<link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
1312
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
1413
<!--
1514
manifest.json provides metadata used when your web app is installed on a

src/App.css

+10-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
1-
.App {
2-
text-align: center;
3-
}
4-
5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
8-
}
9-
10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
14-
}
15-
16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
19-
display: flex;
20-
flex-direction: column;
21-
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
24-
color: white;
25-
}
26-
27-
.App-link {
28-
color: #61dafb;
29-
}
30-
31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
38-
}
1+
@import "../node_modules/@syncfusion/ej2-base/styles/bootstrap5.css";
2+
@import "../node_modules/@syncfusion/ej2-buttons/styles/bootstrap5.css";
3+
@import "../node_modules/@syncfusion/ej2-calendars/styles/bootstrap5.css";
4+
@import "../node_modules/@syncfusion/ej2-dropdowns/styles/bootstrap5.css";
5+
@import "../node_modules/@syncfusion/ej2-inputs/styles/bootstrap5.css";
6+
@import "../node_modules/@syncfusion/ej2-lists/styles/bootstrap5.css";
7+
@import "../node_modules/@syncfusion/ej2-navigations/styles/bootstrap5.css";
8+
@import "../node_modules/@syncfusion/ej2-popups/styles/bootstrap5.css";
9+
@import "../node_modules/@syncfusion/ej2-splitbuttons/styles/bootstrap5.css";
10+
@import "../node_modules/@syncfusion/ej2-react-schedule/styles/bootstrap5.css";

src/App.tsx

+33-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
import React from 'react';
22
import './App.css';
3-
import { ScheduleComponent, Inject, Agenda, Day, Month, Week, WorkWeek, EventSettingsModel } from '@syncfusion/ej2-react-schedule';
4-
import { DataManager,WebApiAdaptor } from '@syncfusion/ej2-data';
5-
class App extends React.Component {
6-
private localData: EventSettingsModel = {
7-
dataSource: [{
8-
EndTime: new Date(2019, 0, 11, 6, 30),
9-
StartTime: new Date(2019, 0, 11, 4, 0)
10-
}]
11-
};
12-
private remoteData = new DataManager({
13-
url: 'https://js.syncfusion.com/demos/ejservices/api/Schedule/LoadData',
14-
adaptor: new WebApiAdaptor,
15-
crossDomain: true
16-
});
17-
18-
19-
render() {
20-
return (
21-
<ScheduleComponent currentView='Month'
22-
eventSettings={{ dataSource: this.remoteData }} selectedDate={new Date(2017, 5, 5)} >
23-
<Inject services={[Day, Week, WorkWeek, Month, Agenda]} />
24-
</ScheduleComponent>
25-
26-
);
27-
}
3+
import { ScheduleComponent, Day, Week, WorkWeek, Month, Agenda, Inject } from '@syncfusion/ej2-react-schedule';
4+
5+
function App() {
6+
const data = [
7+
{
8+
Id: 1,
9+
Subject: 'Paris',
10+
StartTime: new Date(2023, 1, 15, 10, 0),
11+
EndTime: new Date(2023, 1, 15, 12, 30),
12+
},
13+
{
14+
Id: 2,
15+
Subject: 'Germany',
16+
StartTime: new Date(2023, 1, 17, 12, 0),
17+
EndTime: new Date(2023, 1, 17, 13, 30),
18+
},
19+
{
20+
Id: 3,
21+
Subject: 'England',
22+
StartTime: new Date(2023, 1, 13, 9, 0),
23+
EndTime: new Date(2023, 1, 13, 11, 0),
24+
},
25+
];
26+
27+
const eventSettings = { dataSource: data }
28+
return (
29+
<div className="App">
30+
<ScheduleComponent height='550px' selectedDate={new Date(2023, 1, 15)} eventSettings={eventSettings}>
31+
<Inject services={[Day, Week, WorkWeek, Month, Agenda]} />
32+
</ScheduleComponent>
33+
</div>
34+
);
2835
}
29-
3036

31-
export default App;
37+
export default App;

src/index.css

-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ code {
1111
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1212
monospace;
1313
}
14-
15-

src/index.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import ReactDOM from 'react-dom/client';
33
import './index.css';
44
import App from './App';
55
import reportWebVitals from './reportWebVitals';
6-
import { registerLicense } from '@syncfusion/ej2-base';
7-
8-
registerLicense('ORg4AjUWIQA/Gnt2VVhhQlFaclhJWHxMYVF2R2FJeFRycF9FaEwgOX1dQl9hSXpTcEVmWn9feHVRQWY=');
96

107
const root = ReactDOM.createRoot(
118
document.getElementById('root') as HTMLElement

src/react-app-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/// <reference types="react-scripts" />
1+
/// <reference types="react-scripts" />

tsconfig.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
9-
"allowJs": true,
10-
"skipLibCheck": true,
11-
"esModuleInterop": true,
12-
"allowSyntheticDefaultImports": true,
13-
"strict": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"noFallthroughCasesInSwitch": true,
16-
"module": "esnext",
17-
"moduleResolution": "node",
18-
"resolveJsonModule": true,
19-
"isolatedModules": true,
20-
"noEmit": true,
21-
"jsx": "react-jsx"
22-
},
23-
"include": [
24-
"src"
25-
]
26-
}
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true,
13+
"strict": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"noFallthroughCasesInSwitch": true,
16+
"module": "esnext",
17+
"moduleResolution": "node",
18+
"resolveJsonModule": true,
19+
"isolatedModules": true,
20+
"noEmit": true,
21+
"jsx": "react-jsx"
22+
},
23+
"include": [
24+
"src"
25+
]
26+
}

0 commit comments

Comments
 (0)