From 6d93b9872189e39753825117922015d8bc8baab8 Mon Sep 17 00:00:00 2001 From: Ansul Agrawal Date: Mon, 16 Oct 2023 14:58:27 +0530 Subject: [PATCH] Fix ESlint (#108) --- .eslintrc.json | 3 +- .github/dependabot.yml | 10 +- CODE_OF_CONDUCT.md | 42 +++---- CONTRIBUTING.md | 41 ++++-- README.md | 214 ++++++++++++++------------------ package.json | 14 +-- src/components/SchedulerData.js | 10 +- 7 files changed, 157 insertions(+), 177 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 92579c3..b6a8173 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,6 +18,7 @@ "react/jsx-props-no-spreading": "off", "no-underscore-dangle": "off", "no-param-reassign": "off", - "no-console": "off" + "no-console": "off", + "class-methods-use-this": "off" } } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a79795a..8f0c157 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,9 @@ version: 2 updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: 'npm' # See documentation for possible values + directory: '/' # Location of package manifests schedule: - interval: "daily" + interval: 'daily' ignore: - - dependency-name: "react-dnd" - - dependency-name: "react-dnd-html5-backend" + - dependency-name: 'react-dnd' + - dependency-name: 'react-dnd-html5-backend' diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 360a517..3f91224 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -20,28 +20,28 @@ If you see someone who is making an extra effort to ensure our community is welc The following behaviors are expected and requested of all community members: - * Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. - * Exercise consideration and respect in your speech and actions. - * Attempt collaboration before conflict. - * Refrain from demeaning, discriminatory, or harassing behavior and speech. - * Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential. - * Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations. +- Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. +- Exercise consideration and respect in your speech and actions. +- Attempt collaboration before conflict. +- Refrain from demeaning, discriminatory, or harassing behavior and speech. +- Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential. +- Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations. ## 4. Unacceptable Behavior The following behaviors are considered harassment and are unacceptable within our community: - * Violence, threats of violence or violent language directed against another person. - * Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. - * Posting or displaying sexually explicit or violent material. - * Posting or threatening to post other people's personally identifying information ("doxing"). - * Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. - * Inappropriate photography or recording. - * Inappropriate physical contact. You should have someone's consent before touching them. - * Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances. - * Deliberate intimidation, stalking or following (online or in person). - * Advocating for, or encouraging, any of the above behavior. - * Sustained disruption of community events, including talks and presentations. +- Violence, threats of violence or violent language directed against another person. +- Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. +- Posting or displaying sexually explicit or violent material. +- Posting or threatening to post other people's personally identifying information ("doxing"). +- Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. +- Inappropriate photography or recording. +- Inappropriate physical contact. You should have someone's consent before touching them. +- Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances. +- Deliberate intimidation, stalking or following (online or in person). +- Advocating for, or encouraging, any of the above behavior. +- Sustained disruption of community events, including talks and presentations. ## 5. Weapons Policy @@ -59,15 +59,11 @@ If a community member engages in unacceptable behavior, the community organizers If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. React Big Schedule Team. - - Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress. ## 8. Addressing Grievances -If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify react-scheduler with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies. - - +If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify react-scheduler with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies. ## 9. Scope @@ -81,7 +77,7 @@ React Big Schedule Team ## 11. License and attribution -The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/). +The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/). Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9605241..f487e6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,40 +1,55 @@ # Contributing Guide for react-big-schedule + Welcome to the react-big-schedule project! We're thrilled that you're interested in contributing to our open-source scheduling component for React. By contributing to this project, you can help make it even better and support the broader developer community. + ### Code of Conduct + Before you start contributing, please take a moment to read our Code of Conduct. We expect all contributors to adhere to these guidelines to ensure a positive and inclusive community for everyone. You can find our Code of Conduct [here](https://github.com/react-scheduler/react-big-schedule/blob/master/CODE_OF_CONDUCT.md). + ### Getting Started + If you're new to the project, it's a good idea to familiarize yourself with the [README.md](https://github.com/react-scheduler/react-big-schedule/blob/master/README.md) file, which provides an overview of the project and its features. Also, explore existing issues and pull requests to understand the ongoing work and discussions. + ### How to Contribute + We value contributions in various forms – from reporting issues and suggesting improvements to submitting feature requests and providing code changes. To get started with your contributions, follow these steps: + 1. #### Fork the Repository - Begin by forking the main repository to your GitHub account. This will create a personal copy of the project that you can work on. + Begin by forking the main repository to your GitHub account. This will create a personal copy of the project that you can work on. 2. #### Set up the Development Environment - Clone the forked repository to your local machine and set up the development environment using the instructions provided in the [README.md](https://github.com/react-scheduler/react-big-schedule/blob/master/README.md) file. + Clone the forked repository to your local machine and set up the development environment using the instructions provided in the [README.md](https://github.com/react-scheduler/react-big-schedule/blob/master/README.md) file. 3. #### Create a Branch - Create a new branch for your specific contribution. Please use a descriptive and meaningful name for your branch, such as `fix/issue-123` or `feature/new-feature`. + Create a new branch for your specific contribution. Please use a descriptive and meaningful name for your branch, such as `fix/issue-123` or `feature/new-feature`. 4. #### Make Changes - Now comes the coding part! Make the necessary changes to the codebase following the coding guidelines outlined below: + + Now comes the coding part! Make the necessary changes to the codebase following the coding guidelines outlined below: ##### Coding Guidelines + - Follow the JavaScript Standard Style, as it helps maintain a consistent and readable codebase. - Write clear and concise code with meaningful variable and function names. - Include appropriate comments to explain complex logic or important details. - Run the tests and ensure they pass before submitting the changes. + 5. #### Testing - For bug fixes, add new test cases that demonstrate the fixed behavior. For new features, include comprehensive test coverage to maintain a high level of code quality. Run the test suite locally to confirm that all tests pass successfully. + For bug fixes, add new test cases that demonstrate the fixed behavior. For new features, include comprehensive test coverage to maintain a high level of code quality. Run the test suite locally to confirm that all tests pass successfully. 6. #### Commit and Push - Commit your changes with a descriptive and concise commit message. Once you are satisfied with your changes, push the branch to your forked repository. + Commit your changes with a descriptive and concise commit message. Once you are satisfied with your changes, push the branch to your forked repository. 7. #### Create a Pull Request - Go to the original repository and create a Pull Request (PR). Fill in the PR template with relevant information, including a clear description of your changes and the problem they address. A maintainer will review your PR, and there may be some feedback or adjustments required before it gets merged. + Go to the original repository and create a Pull Request (PR). Fill in the PR template with relevant information, including a clear description of your changes and the problem they address. A maintainer will review your PR, and there may be some feedback or adjustments required before it gets merged. 8. #### Collaboration and Feedback - Our maintainers and community members will review your contributions and provide feedback. Be open to suggestions and actively participate in discussions to improve your work. -10. #### Celebrate - Congratulations on your contribution! Your efforts help improve this project for everyone. Once your PR gets merged, your contribution will be acknowledged in the project's release notes and contributors' list. + Our maintainers and community members will review your contributions and provide feedback. Be open to suggestions and actively participate in discussions to improve your work. +9. #### Celebrate + Congratulations on your contribution! Your efforts help improve this project for everyone. Once your PR gets merged, your contribution will be acknowledged in the project's release notes and contributors' list. ### Reporting Issues - If you encounter a bug, have a feature request, or need assistance with the library, please open an issue on the GitHub repository. Use the issue template to provide necessary details to help us understand the problem better. + +If you encounter a bug, have a feature request, or need assistance with the library, please open an issue on the GitHub repository. Use the issue template to provide necessary details to help us understand the problem better. + ### Acknowledgment - Thank you for taking the time to contribute to react-big-schedule! Your passion and effort are what make open-source communities thrive. We value your contributions and look forward to seeing you grow with the project. + +Thank you for taking the time to contribute to react-big-schedule! Your passion and effort are what make open-source communities thrive. We value your contributions and look forward to seeing you grow with the project. + #### Happy coding! -- The react-big-schedule Team +- The react-big-schedule Team diff --git a/README.md b/README.md index fd2489e..e051986 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,56 @@ -# React Big Schedule (react-big-schedule) - [![NPM version][npm-image]][npm-url] [![MIT License][mit-image]][mit-url] [![CodeQL][codeql-image]][codeql-url] [![CodeFactor][codeFactor-badge]][codeFactor-link] - - [npm-image]: http://img.shields.io/npm/v/react-big-schedule.svg - [npm-url]: http://npmjs.org/package/react-big-schedule - [mit-image]: https://img.shields.io/badge/License-MIT-green.svg - [mit-url]: https://github.com/react-scheduler/react-big-schedule/blob/master/LICENSE - [codeql-image]: https://github.com/react-scheduler/react-big-schedule/actions/workflows/github-code-scanning/codeql/badge.svg?branch=master - [codeql-url]: https://github.com/react-scheduler/react-big-schedule/actions/workflows/github-code-scanning/codeql - [codeFactor-badge]: https://www.codefactor.io/repository/github/react-scheduler/react-big-schedule/badge - [codeFactor-link]: https://www.codefactor.io/repository/github/react-scheduler/react-big-schedule +# React Big Schedule (react-big-schedule) +[![NPM version][npm-image]][npm-url] [![MIT License][mit-image]][mit-url] [![CodeQL][codeql-image]][codeql-url] [![CodeFactor][codeFactor-badge]][codeFactor-link] + +[npm-image]: http://img.shields.io/npm/v/react-big-schedule.svg +[npm-url]: http://npmjs.org/package/react-big-schedule +[mit-image]: https://img.shields.io/badge/License-MIT-green.svg +[mit-url]: https://github.com/react-scheduler/react-big-schedule/blob/master/LICENSE +[codeql-image]: https://github.com/react-scheduler/react-big-schedule/actions/workflows/github-code-scanning/codeql/badge.svg?branch=master +[codeql-url]: https://github.com/react-scheduler/react-big-schedule/actions/workflows/github-code-scanning/codeql +[codeFactor-badge]: https://www.codefactor.io/repository/github/react-scheduler/react-big-schedule/badge +[codeFactor-link]: https://www.codefactor.io/repository/github/react-scheduler/react-big-schedule 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. +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. ### This project code is forked from: -* [react-big-scheduler](https://stephenchou1017.github.io/scheduler/#/). -* [react-big-scheduler-stch](https://github.com/hbatalhaStch/react-big-scheduler). + +- [react-big-scheduler](https://stephenchou1017.github.io/scheduler/#/). +- [react-big-scheduler-stch](https://github.com/hbatalhaStch/react-big-scheduler). ## Installation To install react-big-schedule, use npm: + ```bash npm install react-big-schedule ``` -## Tech Stack +## Tech Stack -* React -* Ant Design -* react-dnd -* react-dnd-html5-backend -* webpack -* dayjs +- React +- Ant Design +- react-dnd +- react-dnd-html5-backend +- webpack +- dayjs ## Features -* Modern and intuitive scheduler component for React applications. -* Seamless integration with React projects. -* Drag-and-drop functionality for effortless scheduling. -* Interactive user interface for a smooth user experience -* Granular views to manage time, appointments, and resources effectively. -* Optimized for time management and calendar-based operations. -* Perfect for applications requiring advanced scheduling capabilities. +- Modern and intuitive scheduler component for React applications. +- Seamless integration with React projects. +- Drag-and-drop functionality for effortless scheduling. +- Interactive user interface for a smooth user experience +- Granular views to manage time, appointments, and resources effectively. +- Optimized for time management and calendar-based operations. +- Perfect for applications requiring advanced scheduling capabilities. ## Contributions + Contributions to react-big-schedule are welcome! If you find a bug or want to contribute to the project, please follow these steps: 1. Fork the repository on GitHub. @@ -59,41 +62,48 @@ Contributions to react-big-schedule are welcome! If you find a bug or want to co Please ensure that your code adheres to the project's coding conventions and includes appropriate tests. ## License + React Big Schedule is released under the MIT License. See the [LICENSE](https://github.com/react-scheduler/react-big-schedule/blob/master/LICENSE) file for more details. ## Support + If you have any questions or need support, please create an issue in the [GitHub repository](https://github.com/react-scheduler/react-big-schedule/issues). ## Credits + React Big Schedule is developed and maintained by the React Big Schedule team. We would like to thank the open-source community for their valuable contributions and feedback. Special thanks to the following contributors: -* Ansul Agrawal ([@ansulagrawal](https://github.com/ansulagrawal)) -* Jitendra Soni ([@JitendraSoni1234](https://github.com/JitendraSoni1234)) -* hbatalhaStch [[@hbatalhaStch](https://github.com/hbatalhaStch)) -* DamyanBG ([@DamyanBG](https://github.com/DamyanBG)) + +- Ansul Agrawal ([@ansulagrawal](https://github.com/ansulagrawal)) +- Jitendra Soni ([@JitendraSoni1234](https://github.com/JitendraSoni1234)) +- hbatalhaStch [[@hbatalhaStch](https://github.com/hbatalhaStch)) +- DamyanBG ([@DamyanBG](https://github.com/DamyanBG)) ## Acknowledgments + We would like to acknowledge the following projects for their inspiration and contributions: -* [react-big-scheduler](https://stephenchou1017.github.io/scheduler/#/). -* [react-big-scheduler-stch](https://github.com/hbatalhaStch/react-big-scheduler). + +- [react-big-scheduler](https://stephenchou1017.github.io/scheduler/#/). +- [react-big-scheduler-stch](https://github.com/hbatalhaStch/react-big-scheduler). ## Roadmap -* Additional view options for different scheduling needs. -* Support for recurring appointments. -* Integration with popular calendar services. -* Improved accessibility and localization support. -* Performance optimizations for handling large data sets. + +- Additional view options for different scheduling needs. +- Support for recurring appointments. +- Integration with popular calendar services. +- Improved accessibility and localization support. +- Performance optimizations for handling large data sets. We are continuously working on enhancing react-big-schedule and welcome your feedback and suggestions for future improvements. ## Changelog -Please refer to the [CHANGELOG.md](https://github.com/react-scheduler/react-big-schedule/blob/master/CHANGELOG.md) file. +Please refer to the [CHANGELOG.md](https://github.com/react-scheduler/react-big-schedule/blob/master/CHANGELOG.md) file. ## Use and Setup -1.) Installation +1.) Installation ``` npm i react-big-schedule @@ -114,19 +124,20 @@ import "react-big-schedule/dist/css/style.css"; ``` 3.) Basic Usage + ```js -const schedulerData = new SchedulerData( new dayjs().format(DATE_FORMAT), ViewType.Week ); +const schedulerData = new SchedulerData(new dayjs().format(DATE_FORMAT), ViewType.Week); //set locale dayjs to the schedulerData, if your locale isn't English. By default, Scheduler comes with English(en, United States). -schedulerData.setSchedulerLocale("pt-br"); // this uses dayjs, but it doesn't require dayjs to be installed as its called dynamically -schedulerData.setCalendarPopoverLocale("pt_BR"); // this uses antd [List of supported locales](https://ant.design/docs/react/i18n#supported-languages) +schedulerData.setSchedulerLocale('pt-br'); // this uses dayjs, but it doesn't require dayjs to be installed as its called dynamically +schedulerData.setCalendarPopoverLocale('pt_BR'); // this uses antd [List of supported locales](https://ant.design/docs/react/i18n#supported-languages) schedulerData.setResources([ - { id: "r0", name: "Resource0", groupOnly: true}, - { id: "r1", name: "Resource1" }, - { id: "r2", name: "Resource2", parentId: "r0" }, - { id: "r3", name: "Resource3", parentId: "r4" }, - { id: "r4", name: "Resource4", parentId: "r2" }, + { id: 'r0', name: 'Resource0', groupOnly: true }, + { id: 'r1', name: 'Resource1' }, + { id: 'r2', name: 'Resource2', parentId: 'r0' }, + { id: 'r3', name: 'Resource3', parentId: 'r4' }, + { id: 'r4', name: 'Resource4', parentId: 'r2' }, ]); // the event array should be sorted in ascending order by event.start property @@ -134,44 +145,44 @@ schedulerData.setResources([ schedulerData.setEvents([ { id: 1, - start: "2022-12-18 09:30:00", - end: "2022-12-19 23:30:00", - resourceId: "r1", - title: "I am finished", - bgColor: "#D9D9D9", + start: '2022-12-18 09:30:00', + end: '2022-12-19 23:30:00', + resourceId: 'r1', + title: 'I am finished', + bgColor: '#D9D9D9', }, { id: 2, - start: "2022-12-18 12:30:00", - end: "2022-12-26 23:30:00", - resourceId: "r2", - title: "I am not resizable", + start: '2022-12-18 12:30:00', + end: '2022-12-26 23:30:00', + resourceId: 'r2', + title: 'I am not resizable', resizable: false, }, { id: 3, - start: "2022-12-19 12:30:00", - end: "2022-12-20 23:30:00", - resourceId: "r3", - title: "I am not movable", + start: '2022-12-19 12:30:00', + end: '2022-12-20 23:30:00', + resourceId: 'r3', + title: 'I am not movable', movable: false, }, { id: 4, - start: "2022-12-19 14:30:00", - end: "2022-12-20 23:30:00", - resourceId: "r1", - title: "I am not start-resizable", + start: '2022-12-19 14:30:00', + end: '2022-12-20 23:30:00', + resourceId: 'r1', + title: 'I am not start-resizable', startResizable: false, }, { id: 5, - start: "2022-12-19 15:30:00", - end: "2022-12-20 23:30:00", - resourceId: "r2", - title: "R2 has recurring tasks every week on Tuesday, Friday", - rrule: "FREQ=WEEKLY;DTSTART=20221219T013000Z;BYDAY=TU,FR", - bgColor: "#f759ab", + start: '2022-12-19 15:30:00', + end: '2022-12-20 23:30:00', + resourceId: 'r2', + title: 'R2 has recurring tasks every week on Tuesday, Friday', + rrule: 'FREQ=WEEKLY;DTSTART=20221219T013000Z;BYDAY=TU,FR', + bgColor: '#f759ab', }, ]); @@ -189,10 +200,8 @@ schedulerData.setEvents([ />; ``` - ### Run examples locally - - Clone this repository - Retrieve dependencies: `npm install` or `npm i` - Start: `npm run start` @@ -202,7 +211,6 @@ If you fail to execute the `npm install` command, remove the package-lock.json f # API - ### SchedulerData SchedulerData is the view model of Scheduler, we can modify it to control the view of the Scheduler. @@ -252,6 +260,7 @@ Used to set locale to the scheduler, it uses dayjs locales ([List of supported l `preset` will be locale imported from dayjs. #### example: + ```js import * as dayjsLocale from 'dayjs/locale/pt-br'; @@ -269,6 +278,7 @@ setCalendarPopoverLocale(lang); Used to set locale to the calendar popover. it uses antd locales ([List of supported locales](https://ant.design/docs/react/i18n#supported-languages)). By default, it comes with English(en, United States) #### example: + ```js import * as antdLocale from 'antd/locale/pt_BR'; @@ -307,7 +317,6 @@ Let the time window scroll to the left once. When `SchedulerData,viewType` is `V scroll a month, when `SchedulerData,viewType` is `ViewType.Week`, the time window will scroll a week. `SchedulerData.events` will be clear after calling this method. - #### next ```js @@ -327,11 +336,7 @@ Let the time window jump to the provided `date` directly. `SchedulerData.events` #### setViewType ```js -setViewType( - (viewType = ViewType.Week), - (showAgenda = false), - (isEventPerspective = false) -); +setViewType((viewType = ViewType.Week), (showAgenda = false), (isEventPerspective = false)); ``` Tell SchedulerData to change current view, the `viewType`, `showAgenda` and `isEventPerspective` group should be @@ -757,14 +762,7 @@ Method that defines non-working time. #### getSummaryFunc ```js -getSummary( - schedulerData, - headerEvents, - slotId, - slotName, - headerStart, - headerEnd -); +getSummary(schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd); ``` Method that defines the summary text displayed in the Scheduler cells.Refer @@ -914,16 +912,7 @@ to [this example](https://stephenchou1017.github.io/scheduler/#/customheader). ```js conflictOccurred: PropTypes.func; -conflictOccurred( - schedulerData, - action, - event, - type, - slotId, - slotName, - start, - end -); +conflictOccurred(schedulerData, action, event, type, slotId, slotName, start, end); ``` Callback function fired when there is a conflict. This could happen when creating, resizing or moving an event, and when @@ -933,16 +922,7 @@ Callback function fired when there is a conflict. This could happen when creatin ```js eventItemTemplateResolver: PropTypes.func; -eventItemTemplateResolver( - schedulerData, - event, - bgColor, - isStart, - isEnd, - mustAddCssClass, - mustBeHeight, - agendaMaxEventWidth -); +eventItemTemplateResolver(schedulerData, event, bgColor, isStart, isEnd, mustAddCssClass, mustBeHeight, agendaMaxEventWidth); ``` Use this function, you can customize the event style. Refer to [this example](https://stephenchou1017.github.io/scheduler/#/customeventstyle). @@ -951,14 +931,7 @@ Use this function, you can customize the event style. Refer to [this example](ht ```js eventItemPopoverTemplateResolver: PropTypes.func; -eventItemPopoverTemplateResolver( - schedulerData, - eventItem, - title, - start, - end, - statusColor -); +eventItemPopoverTemplateResolver(schedulerData, eventItem, title, start, end, statusColor); ``` Use this function, you can customize the event's popover style. Refer to [this example](https://stephenchou1017.github.io/scheduler/#/custompopover). @@ -976,12 +949,7 @@ Use this function, you can customize the left slot style. ```js nonAgendaCellHeaderTemplateResolver: PropTypes.func; -nonAgendaCellHeaderTemplateResolver( - schedulerData, - item, - formattedDateItems, - style -); +nonAgendaCellHeaderTemplateResolver(schedulerData, item, formattedDateItems, style); ``` Use this function, you can customize the table header cell style. Refer to [this example](https://stephenchou1017.github.io/scheduler/#/customtableheaders). diff --git a/package.json b/package.json index d02a2e0..dedb751 100644 --- a/package.json +++ b/package.json @@ -60,8 +60,8 @@ }, "dependencies": { "@ant-design/icons": "^5.2.6", - "antd": "^5.9.0", - "dayjs": "^1.11.9", + "antd": "^5.10.1", + "dayjs": "^1.11.10", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dnd": "^14.0.5", @@ -70,15 +70,15 @@ "rrule": "^2.7.2" }, "devDependencies": { - "@babel/cli": "^7.22.15", - "@babel/core": "^7.22.17", + "@babel/cli": "^7.23.0", + "@babel/core": "^7.23.2", "@babel/eslint-parser": "^7.22.15", - "@babel/preset-env": "^7.22.15", + "@babel/preset-env": "^7.23.2", "@babel/preset-react": "^7.22.15", "babel-loader": "^9.1.3", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.8.1", - "eslint": "^8.49.0", + "eslint": "^8.51.0", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-import": "^2.28.1", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -88,7 +88,7 @@ "fs-extra": "^11.1.1", "html-webpack-plugin": "^5.5.3", "style-loader": "^3.3.3", - "webpack": "^5.88.2", + "webpack": "^5.89.0", "webpack-cli": "^5.1.4", "webpack-dev-server": "^4.15.1" } diff --git a/src/components/SchedulerData.js b/src/components/SchedulerData.js index b60cd68..4913173 100644 --- a/src/components/SchedulerData.js +++ b/src/components/SchedulerData.js @@ -937,11 +937,11 @@ export default class SchedulerData { _getSpan(startTime, endTime, headers) { if (this.showAgenda) return 1; - function startOfWeek(date) { - const day = date.getDay(); - const diff = date.getDate() - day; - return new Date(date.getFullYear(), date.getMonth(), diff); - } + // function startOfWeek(date) { + // const day = date.getDay(); + // const diff = date.getDate() - day; + // return new Date(date.getFullYear(), date.getMonth(), diff); + // } const timeBetween = (date1, date2, timeIn) => { if (timeIn === 'days' || timeIn === 'day') {