Skip to content

Commit 18065d8

Browse files
authored
Version 4.3.4 (#133)
2 parents 75b3dd0 + 2f87b73 commit 18065d8

File tree

5 files changed

+126
-115
lines changed

5 files changed

+126
-115
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [4.3.4](https://github.com/react-scheduler/react-big-schedule/compare/4.3.3...4.3.4)
2+
3+
`2024-02-21`
4+
5+
- Updated `node_modules` version by [@ansulagrawal](https://github.com/ansulagrawal) in [#132](https://github.com/react-scheduler/react-big-schedule/pull/132).
6+
- Fix Issue of Displaying hour headers properly in ViewType.Da by [@ansulagrawal](https://github.com/ansulagrawal) in [#131](https://github.com/react-scheduler/react-big-schedule/pull/131).
7+
- Bump webpack-dev-server from 4.15.1 to 5.0.2 by [@dependabot](https://github.com/dependabot) in [#130](https://github.com/react-scheduler/react-big-schedule/pull/130).
8+
19
## [4.3.3](https://github.com/react-scheduler/react-big-schedule/compare/4.3.2...4.3.3)
210

311
`2023-12-16`

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We take the security of react-big-schedule seriously. If you believe you have fo
77

88
| Version | Supported |
99
| --------| --------- |
10-
| 4.3.1 | :white_check_mark: |
10+
| 4.3.2 or grater | :white_check_mark: |
1111
| 4.2.5 | :white_check_mark: |
1212
| rest all | :x: |
1313

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-big-schedule",
3-
"version": "4.3.3",
3+
"version": "4.3.4",
44
"description": "React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React. Seamlessly integrate this modern browser-compatible component into your applications to effectively manage time, appointments, and resources. With drag-and-drop functionality, interactive UI, and granular views, react-big-schedule empowers users to effortlessly schedule and allocate resources with precision. Enhance productivity and streamline your workflow with this React-based solution, designed to optimize time management and simplify calendar-based operations. Perfect for applications requiring advanced scheduling capabilities, react-big-schedule offers a seamless and intuitive experience for managing appointments, resource allocation, and time slots. Unlock the potential of your React projects with react-big-schedule and revolutionize the way you handle scheduling and resource planning. It is the updated version of react-big-scheduler",
55
"keywords": [
66
"react-big-schedule",
@@ -59,8 +59,8 @@
5959
"fix": "eslint ./"
6060
},
6161
"dependencies": {
62-
"@ant-design/icons": "^5.2.6",
63-
"antd": "^5.12.2",
62+
"@ant-design/icons": "^5.3.0",
63+
"antd": "^5.14.1",
6464
"dayjs": "^1.11.10",
6565
"prop-types": "^15.8.1",
6666
"react": "^18.2.0",
@@ -70,14 +70,14 @@
7070
"rrule": "^2.8.1"
7171
},
7272
"devDependencies": {
73-
"@babel/cli": "^7.23.4",
74-
"@babel/core": "^7.23.6",
75-
"@babel/eslint-parser": "^7.23.3",
76-
"@babel/preset-env": "^7.23.6",
73+
"@babel/cli": "^7.23.9",
74+
"@babel/core": "^7.23.9",
75+
"@babel/eslint-parser": "^7.23.10",
76+
"@babel/preset-env": "^7.23.9",
7777
"@babel/preset-react": "^7.23.3",
7878
"babel-loader": "^9.1.3",
79-
"copy-webpack-plugin": "^11.0.0",
80-
"css-loader": "^6.8.1",
79+
"copy-webpack-plugin": "^12.0.2",
80+
"css-loader": "^6.10.0",
8181
"eslint": "^8.56.0",
8282
"eslint-config-airbnb": "^19.0.4",
8383
"eslint-plugin-import": "^2.29.1",
@@ -86,10 +86,10 @@
8686
"eslint-plugin-react-hooks": "^4.6.0",
8787
"eslint-webpack-plugin": "^4.0.1",
8888
"fs-extra": "^11.2.0",
89-
"html-webpack-plugin": "^5.5.4",
90-
"style-loader": "^3.3.3",
91-
"webpack": "^5.89.0",
89+
"html-webpack-plugin": "^5.6.0",
90+
"style-loader": "^3.3.4",
91+
"webpack": "^5.90.3",
9292
"webpack-cli": "^5.1.4",
93-
"webpack-dev-server": "^4.15.1"
93+
"webpack-dev-server": "^5.0.2"
9494
}
9595
}

src/components/SchedulerData.js

+103-101
Original file line numberDiff line numberDiff line change
@@ -657,124 +657,126 @@ export default class SchedulerData {
657657
}
658658

659659
// Previous Code
660-
// _createHeaders() {
661-
// const headers = [];
662-
// let start = this.localeDayjs(new Date(this.startDate));
663-
// let end = this.localeDayjs(new Date(this.endDate));
664-
// let header = start;
665-
666-
// if (this.showAgenda) {
667-
// headers.push({ time: header.format(DATETIME_FORMAT), nonWorkingTime: false });
668-
// } else if (this.cellUnit === CellUnit.Hour) {
669-
// if (start.hour() === 0) {
670-
// start = start.add(this.config.dayStartFrom, 'hours');
671-
// }
672-
// if (end.hour() === 0) {
673-
// end = end.add(this.config.dayStopTo, 'hours');
674-
// }
675-
// header = start;
676-
677-
// let prevHour = -1;
678-
// while (header >= start && header <= end) {
679-
// // prevent doubled hours on time change
680-
// if (header.hour() === prevHour) {
681-
// header = header.add(1, 'hours');
682-
// continue;
683-
// }
684-
// prevHour = header.hour();
685-
// const minuteSteps = this.getMinuteStepsInHour();
686-
// for (let i = 0; i < minuteSteps; i++) {
687-
// const hour = header.hour();
688-
// if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
689-
// const time = header.format(DATETIME_FORMAT);
690-
// const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
691-
// headers.push({ time, nonWorkingTime });
692-
// }
693-
694-
// header = header.add(this.config.minuteStep, 'minutes');
695-
// }
696-
// }
697-
// } else if (this.cellUnit === CellUnit.Day) {
698-
// while (header >= start && header <= end) {
699-
// const time = header.format(DATETIME_FORMAT);
700-
// const dayOfWeek = header.weekday();
701-
// if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
702-
// const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
703-
// headers.push({ time, nonWorkingTime });
704-
// }
705-
706-
// header = header.add(1, 'days');
707-
// }
708-
// } else if (this.cellUnit === CellUnit.Week) {
709-
// while (header >= start && header <= end) {
710-
// const time = header.format(DATE_FORMAT);
711-
// headers.push({ time });
712-
// header = header.add(1, 'weeks').startOf('week');
713-
// }
714-
// } else if (this.cellUnit === CellUnit.Month) {
715-
// while (header >= start && header <= end) {
716-
// const time = header.format(DATE_FORMAT);
717-
// headers.push({ time });
718-
// header = header.add(1, 'months').startOf('month');
719-
// }
720-
// } else if (this.cellUnit === CellUnit.Year) {
721-
// while (header >= start && header <= end) {
722-
// const time = header.format(DATE_FORMAT);
723-
// headers.push({ time });
724-
// header = header.add(1, 'years').startOf('year');
725-
// }
726-
// }
727-
728-
// this.headers = headers;
729-
// }
730-
731660
_createHeaders() {
732661
const headers = [];
733-
const start = this.localeDayjs(new Date(this.startDate));
734-
const end = this.localeDayjs(new Date(this.endDate));
662+
let start = this.localeDayjs(new Date(this.startDate));
663+
let end = this.localeDayjs(new Date(this.endDate));
664+
let header = start;
735665

736-
const processHeader = (header, format, unit, incrementFn) => {
737-
let head = header;
738-
while (head >= start && head <= end) {
739-
const time = head.format(format);
740-
if (unit === CellUnit.Day) {
741-
const dayOfWeek = head.weekday();
742-
if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
666+
if (this.showAgenda) {
667+
headers.push({ time: header.format(DATETIME_FORMAT), nonWorkingTime: false });
668+
} else if (this.cellUnit === CellUnit.Hour) {
669+
if (start.hour() === 0) {
670+
start = start.add(this.config.dayStartFrom, 'hours');
671+
}
672+
if (end.hour() === 0) {
673+
end = end.add(this.config.dayStopTo, 'hours');
674+
}
675+
header = start;
676+
677+
let prevHour = -1;
678+
while (header >= start && header <= end) {
679+
// prevent doubled hours on time change
680+
if (header.hour() === prevHour) {
681+
header = header.add(1, 'hours');
682+
// eslint-disable-next-line no-continue
683+
continue;
684+
}
685+
prevHour = header.hour();
686+
const minuteSteps = this.getMinuteStepsInHour();
687+
for (let i = 0; i < minuteSteps; i += 1) {
688+
const hour = header.hour();
689+
if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
690+
const time = header.format(DATETIME_FORMAT);
743691
const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
744692
headers.push({ time, nonWorkingTime });
745693
}
746-
} else {
747-
headers.push({ time });
694+
695+
header = header.add(this.config.minuteStep, 'minutes');
748696
}
749-
head = head.add(1, incrementFn);
750697
}
751-
};
752-
753-
if (this.showAgenda) {
754-
headers.push({ time: start.format(DATETIME_FORMAT), nonWorkingTime: false });
755-
} else if (this.cellUnit === CellUnit.Hour) {
756-
const hourIncrement = this.config.minuteStep < 60 ? 'minutes' : 'hours';
757-
const minuteSteps = this.getMinuteStepsInHour();
758-
let header = start.hour() === 0 ? start.add(this.config.dayStartFrom, 'hours') : start;
759-
while (header <= end) {
760-
const hour = header.hour();
761-
if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
762-
const time = header.format(DATETIME_FORMAT);
698+
} else if (this.cellUnit === CellUnit.Day) {
699+
while (header >= start && header <= end) {
700+
const time = header.format(DATETIME_FORMAT);
701+
const dayOfWeek = header.weekday();
702+
if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
763703
const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
764704
headers.push({ time, nonWorkingTime });
765705
}
766-
header = header.add(minuteSteps, hourIncrement);
706+
707+
header = header.add(1, 'days');
708+
}
709+
} else if (this.cellUnit === CellUnit.Week) {
710+
while (header >= start && header <= end) {
711+
const time = header.format(DATE_FORMAT);
712+
headers.push({ time });
713+
header = header.add(1, 'weeks').startOf('week');
714+
}
715+
} else if (this.cellUnit === CellUnit.Month) {
716+
while (header >= start && header <= end) {
717+
const time = header.format(DATE_FORMAT);
718+
headers.push({ time });
719+
header = header.add(1, 'months').startOf('month');
720+
}
721+
} else if (this.cellUnit === CellUnit.Year) {
722+
while (header >= start && header <= end) {
723+
const time = header.format(DATE_FORMAT);
724+
headers.push({ time });
725+
header = header.add(1, 'years').startOf('year');
767726
}
768-
} else {
769-
const header = start;
770-
const format = this.cellUnit === CellUnit.Day ? DATETIME_FORMAT : DATE_FORMAT;
771-
const incrementFn = this.cellUnit === CellUnit.Day ? 'days' : `${this.cellUnit}s`;
772-
processHeader(header, format, this.cellUnit, incrementFn);
773727
}
774728

775729
this.headers = headers;
776730
}
777731

732+
// Fix Optimited code
733+
// _createHeaders() {
734+
// const headers = [];
735+
// const start = this.localeDayjs(new Date(this.startDate));
736+
// const end = this.localeDayjs(new Date(this.endDate));
737+
738+
// const processHeader = (header, format, unit, incrementFn) => {
739+
// let head = header;
740+
// while (head >= start && head <= end) {
741+
// const time = head.format(format);
742+
// if (unit === CellUnit.Day) {
743+
// const dayOfWeek = head.weekday();
744+
// if (this.config.displayWeekend || (dayOfWeek !== 0 && dayOfWeek !== 6)) {
745+
// const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
746+
// headers.push({ time, nonWorkingTime });
747+
// }
748+
// } else {
749+
// headers.push({ time });
750+
// }
751+
// head = head.add(1, incrementFn);
752+
// }
753+
// };
754+
755+
// if (this.showAgenda) {
756+
// headers.push({ time: start.format(DATETIME_FORMAT), nonWorkingTime: false });
757+
// } else if (this.cellUnit === CellUnit.Hour) {
758+
// const hourIncrement = this.config.minuteStep < 60 ? 'minutes' : 'hours';
759+
// const minuteSteps = this.getMinuteStepsInHour();
760+
// let header = start.hour() === 0 ? start.add(this.config.dayStartFrom, 'hours') : start;
761+
// while (header <= end) {
762+
// const hour = header.hour();
763+
// if (hour >= this.config.dayStartFrom && hour <= this.config.dayStopTo) {
764+
// const time = header.format(DATETIME_FORMAT);
765+
// const nonWorkingTime = this.behaviors.isNonWorkingTimeFunc(this, time);
766+
// headers.push({ time, nonWorkingTime });
767+
// }
768+
// header = header.add(minuteSteps, hourIncrement);
769+
// }
770+
// } else {
771+
// const header = start;
772+
// const format = this.cellUnit === CellUnit.Day ? DATETIME_FORMAT : DATE_FORMAT;
773+
// const incrementFn = this.cellUnit === CellUnit.Day ? 'days' : `${this.cellUnit}s`;
774+
// processHeader(header, format, this.cellUnit, incrementFn);
775+
// }
776+
777+
// this.headers = headers;
778+
// }
779+
778780
_createInitHeaderEvents(header) {
779781
const start = this.localeDayjs(new Date(header.time));
780782
const startValue = start.format(DATETIME_FORMAT);

webpack/webpack.dev.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
const path = require('path');
23
const HtmlWebpackPlugin = require('html-webpack-plugin');
34
const ESLintWebpackPlugin = require('eslint-webpack-plugin');

0 commit comments

Comments
 (0)