Coder Social home page Coder Social logo

react-scheduler / react-big-schedule Goto Github PK

View Code? Open in Web Editor NEW
49.0 1.0 11.0 987 KB

React Big Schedule is a powerful and intuitive scheduler and resource planning solution built with React.

Home Page: https://react-big-schedule.vercel.app/

License: MIT License

HTML 0.21% JavaScript 97.89% CSS 1.90%
npm-package react react-scheduler scheduler react-big-schedule react-big-scheduler libraries npm-lib npm-library npm-module

react-big-schedule's Introduction

React Big Schedule (react-big-schedule)

NPM version MIT License CodeQL CodeFactor

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.

This project code is forked from:

Installation

To install react-big-schedule, use npm:

  npm install react-big-schedule

Tech Stack

  • 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.

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.
  2. Create a new branch with a descriptive name.
  3. Make your changes and commit them with clear messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the master repository.

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 file for more details.

Support

If you have any questions or need support, please create an issue in the GitHub repository.

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:

Acknowledgments

We would like to acknowledge the following projects for their inspiration and contributions:

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.

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 file.

Use and Setup

1.) Installation

  npm i react-big-schedule

or

  yarn add react-big-schedule

2.) Import dependencies

import { Scheduler, SchedulerData, ViewType, DATE_FORMAT } from "react-big-schedule";
import dayjs from "dayjs";
import "react-big-schedule/dist/css/style.css";

3.) Basic Usage

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.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' },
]);

// the event array should be sorted in ascending order by event.start property
// otherwise there will be some rendering errors
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',
  },
  {
    id: 2,
    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',
    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',
    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',
  },
]);

// ...

//3. render the scheduler component, mind that the Scheduler component should be placed in a DragDropContext(father or ancestor).

<Scheduler
  schedulerData={schedulerData}
  prevClick={this.prevClick}
  nextClick={this.nextClick}
  onSelectDate={this.onSelectDate}
  onViewChange={this.onViewChange}
  eventItemClick={this.eventClicked}
/>;

Run examples locally

  • Clone this repository
  • Retrieve dependencies: npm install or npm i
  • Start: npm run start
  • Open http://localhost:8080.

If you fail to execute the npm install command, remove the package-lock.json file and try again.

API

SchedulerData

SchedulerData is the view model of Scheduler, we can modify it to control the view of the Scheduler.

constructor

constructor(date=dayjs().format(DATE_FORMAT), viewType = ViewType.Week,
                showAgenda = false, isEventPerspective = false,
                newConfig = undefined, newBehaviors=undefined
                localeDayjs = undefined)
  • date is a string in YYYY-MM-DD format, and is the initial date Scheduler will render. Take the date 2022-12-20 for example, Scheduler will render the time window of the week from 2022-12-18 to 2022-12-24 in ViewType.Week view type, and will render the time window of the 2022-12 month in ViewType.Month view type.
  • viewType is the initial view type, now Scheduler supports Day, Week, Month, Quarter, Year 5 built-in view types, in addition Scheduler now supports Custom, Custom1, Custom2 3 custom view types at the same time, in which you can control the time window yourself, refer to this example. viewType, showAgenda and isEventPerspective are a group which should be contained in the SchedulerData.config.views array, and they together decide which view should be rendered. When showAgenda and isEventPerspective are both false, Scheduler will render the resource view, refer to this example.
  • showAgenda is a bool value, if true, Scheduler will display the agenda view of current view type. Agenda view is read only.
  • isEventPerspective is a bool value, if true, Scheduler will display the task view of current view type. In resource view, every slot(row) describes how many events a resource does in the time window, while in task view, every slot describes how many events a big task is divided into and who will make it done. Add a groupId and groupName property to every event object, so that the events having the same groupId will belong to the same big task and be rendered in the same slot in task view. If groupId and groupName are not provided, SchedulerData will take the id as the groupId, and take the title as the groupName. See the eventsForTaskView in the sample1.js for details.
  • newConfig is a config object, used to override the default config fully or partly.
  • newBehaviors is a config object, used to override the default behaviors fully or partly.
  • localeDayjs is a locale dayjs object, which is unified used in react-big-scheduler. If not provided, Scheduler will come with English(en, United States) locale strings.

setSchedulerLocale

setSchedulerLocale(preset);

Used to set locale to the scheduler, it uses dayjs locales (List of supported locales) and it is loaded on demand.

preset will be locale imported from dayjs.

example:

import * as dayjsLocale from 'dayjs/locale/pt-br';

setSchedulerLocale(dayjsLocale);

By default, Scheduler comes with English(en, United States)

setCalendarPopoverLocale

setCalendarPopoverLocale(lang);

Used to set locale to the calendar popover. it uses antd locales (List of supported locales). By default, it comes with English(en, United States)

example:

import * as antdLocale from 'antd/locale/pt_BR';

setCalendarPopoverLocale(antdLocale);

refer this for the demo of the locale.

setResources

setResources(resources);

Used to set the resources(the slots in resource view), make sure that there are no duplicated resource.id in the resources. See the demo resources in the sample1.js.

setEvents

setEvents(events);

Used to set the events. the event array should be sorted in ascending order by event.start property. See the demo events in the sample1.js. If we use the task view, we'd better add the groupId and the groupName property to each event object, see the eventsForTaskView in the sample1.js for details.

prev

prev();

Let the time window scroll to the left once. When SchedulerData,viewType is ViewType.Month, the time window will 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

next();

Let the time window scroll to the right once. SchedulerData.events will be clear after calling this method.

setDate

setDate((date = dayjs().format(DATE_FORMAT)));

Let the time window jump to the provided date directly. SchedulerData.events will be clear after calling this method.

setViewType

setViewType((viewType = ViewType.Week), (showAgenda = false), (isEventPerspective = false));

Tell SchedulerData to change current view, the viewType, showAgenda and isEventPerspective group should be provided, and should be contained in the SchedulerData.config.views array. SchedulerData.events will be clear after calling this method.

setEventGroups

setEventGroups(eventGroups);

Used to set the event groups(the slots in task view), make sure that there are no duplicated eventGroup.id in the eventGroups. This method is optional, and is needed only when SchedulerData.eventGroupsAutoGenerated is false.

setEventGroupsAutoGenerated

setEventGroupsAutoGenerated(autoGenerated);

Tell SchedulerData to generate SchedulerData.eventGroups automatically or not. If true, SchedulerData will generate the event groups(slots) automatically according to the event.groupId and 'event.groupName' automatically. If groupId and 'groupName' are not provided, SchedulerData will take event.id and event.title instead.

setMinuteStep

setMinuteStep(minuteStep);

Used to set minute step for daily view and refresh the render data.

toggleExpandStatus

toggleExpandStatus(slotId);

Used to toggle slot's(and its children's) expand status.

getMinuteStepsInHour

getMinuteStepsInHour();

Used to get minute steps in an hour, it equals 60 / SchedulerData.config.minuteStep.

addResource

addResource(resource);

Add the resource to the SchedulerData.resources, make sure that resource.id is not duplicated. Refer to this example.

addEventGroup

addEventGroup(eventGroup);

Add the eventGroup to the SchedulerData.eventGroups, make sure that eventGroup.id is not duplicated. Please note that the eventGroup added may be override when SchedulerData.eventGroupsAutoGenerated is true and SchedulerData.eventGroups is auto-generated.

addEvent

addEvent(newEvent);

Add the newEvent to the SchedulerData.events, make sure that newEvent.id is not duplicated. SchedulerData will place the newEvent in the right index according to the newEvent.start property.

updateEventStart

updateEventStart(event, newStart);

Update the newStart to the event.start, newStart is a string in YYYY-MM-DD HH:mm:ss format(similarly hereinafter). SchedulerData will replace the event in the right index according to the newStart value.

updateEventEnd

updateEventEnd(event, newEnd);

Update the newEnd to the event.end.

moveEvent

moveEvent(event, newSlotId, newSlotName, newStart, newEnd);

Update the newSlotId, newSlotName, newStart, newEnd of the event. In resource view, new slot is a resource, while in task view, new slot is a event group. SchedulerData will replace the event in the right index according to the newStart value.

removeEvent

removeEvent(event);

Remove the given event from SchedeulerData.events.

removeEventById

removeEventById(eventId);

Remove event from SchedeulerData.events by the given event id.

getSlots

getSlots();

Returns the slot array, SchedulerData.resources in resource view, SchedulerData.eventGroups in task view.

getSlotById

getSlotById(slotId);

Returns the slot by slotId, returns undefined if not found.

getResourceById

getResourceById(resourceId);

isEventInTimeWindow

isEventInTimeWindow(eventStart, eventEnd, windowStart, windowEnd);

Returns whether an event is in the time window or not, remind that eventStart, eventEnd, windowStart, windowEnd are all dayjs | Date objects.

getViewDates

getViewDates();

Returns an object with the startDate and endDate of the currently selected view ({ startDate: Dayjs, endDate: Dayjs }).

getViewStartDate

getViewStartDate();

Returns a dayjs object with the startDate of the currently selected view.

getViewEndDate

getViewEndDate();

Returns a dayjs object with the endDate of the currently selected view.

Locale support(Refer to this example for details.)

SchedulerData.config.resourceName

The locale string of resource name.

SchedulerData.config.taskName

The locale string of task name.

SchedulerData.config.agendaViewHeader

The locale string of agenda view header.

SchedulerData.config.addMorePopoverHeaderFormat

The locale string of add more popover header format.

SchedulerData.config.eventItemPopoverDateFormat

The locale string of event item popover date format.

SchedulerData.config.nonAgendaDayCellHeaderFormat

The locale string of non-agenda view cell header format of day view type.

SchedulerData.config.nonAgendaOtherCellHeaderFormat

The locale string of non-agenda view cell header format of other view types.

SchedulerData.behaviors.getDateLabelFunc

Used to resolve the locale string of date label of Scheduler component.(Refer to the getDateLabel func for example)

SchedulerData.config(See the config file for details.)

schedulerWidth

The width of Scheduler. Scheduler uses responsive layout so schedulerWidth should be a percentage, Scheduler in the responsive layout: actual width of Scheduler = (SchedulerData.documentWidth - SchedulerData.config.besidesWidth) * SchedulerData.config.schedulerWidth SchedulerData.documentWidth is the window width of browser (or the the parent width in case SchedulerData.config.responsiveByParent and Scheduler component prop parentRef is passed) and will change automatically when resized.

responsiveByParent

When true, Scheduler resposiveness will not be determined by the window width of browser but instead by the width of the of the parent (the parent ref must be passed to the Scheduler component prop named parentRef, in case it is not passed resposiveness will fall back to being determined by the window width). Meaning: SchedulerData.documentWidth is the width of the parent and will change automatically when resized

schedulerMaxHeight

The max height of Scheduler. If the desired height is bigger than the max height, the header row of Scheduler will be frozen and vertical scroll bar will appear, but this won't happen when the max height is set to 0. Refer to this example.

tableHeaderHeight

Height of Scheduler table header.

agendaResourceTableWidth

Width of the left Scheduler resource column in agenda view.

agendaMaxEventWidth

Max width of an event item in agenda view.

dayResourceTableWidth, weekResourceTableWidth, monthResourceTableWidth, yearResourceTableWidth, quarterResourceTableWidth

Width of the left Scheduler resource column in resource view and task view of different view types.

dayCellWidth, weekCellWidth, monthCellWidth, yearCellWidth, quarterCellWidth

Width of Scheduler table cells in resource view and task view of different view types.

dayMaxEvents, weekMaxEvents, monthMaxEvents, yearMaxEvents, quarterMaxEvents

Max events count of a cell in resource view and task view of different view types. A '+N more' will appear when exceeded. Refer to this example.

eventItemHeight

Height of an event item in 3 views.

eventItemLineHeight

Line height of an event item in 3 views.

nonAgendaSlotMinHeight

Min height of a slot in non-agenda views, default 0, means there is no min height.

dayStartFrom

Start hour rendered from in ViewType.Day in resource view and task view, default 0.

dayStopTo

End hour rendered to in ViewType.Day in resource view and task view, default 23.

defaultEventBgColor

Default event item background color in 3 views, will be override if there is a bgColor property in event object.

selectedAreaColor

Selected cells color in resource view and task view, cells are selectable only when creatable is true.

nonWorkingTimeHeadColor

Color of non-working time head cells. Modify SchedulerData.behaviors.isNonWorkingTimeFunc to re-define non-working time. Refer the isNonWorkingTime func in the behaviors.js.

nonWorkingTimeHeadBgColor

Background color of non-working time head cells.

nonWorkingTimeBodyBgColor

Background color of non-working time body cells.

summaryColor

Color of cell summary. Modify SchedulerData.behaviors.getSummaryFunc to display summary in a cell. Refer the getSummary func in the behaviors.js.

summaryPos

Position of cell summary, supports SummaryPos.Top, SummaryPos.TopRight, SummaryPos.TopLeft, SummaryPos.Bottom, SummaryPos.BottomRight and SummaryPos.BottomLeft.

startResizable

Controls whether to resize the start of every event item in resource view and task view. If false, all item starts are non-resizable, if true, all item starts are resizable except those who have a resizable or startResizable property and its value is false.

endResizable

Controls whether to resize the end of every event item in resource view and task view. If false, all item ends are non-resizable, if true, all item ends are resizable except those who have a resizable or endResizable property and its value is false.

movable

Controls whether to move every event item in resource view and task view. If false, all items are non-movable, if true, all items are movable except those who have a movable property and its value is false.

creatable

Controls whether to create new event item in resource view and task view.

crossResourceMove

Controls whether to cross-slot move an event item in resource view and task view. If false, the slotId and slotName won't change in the moveEvent method. Refer to this example.

checkConflict

Controls whether to check conflicts when creating, resizing or moving an event item in resource view and task view. If true, Scheduler will call the conflictOccurred function if given. Refer to this example.

scrollToSpecialDayjsEnabled

Controls Scheduler whether to scroll to special dayjs automatically when the time window contains special dayjs. If true, Scheduler horizontal bar will scroll to special dayjs after calling setScrollToSpecialDayjs(true) to SchedulerData. Use SchedulerData.behaviors.getScrollSpecialDayjsFunc to tell Scheduler what time the special dayjs is.

eventItemPopoverEnabled

Controls Scheduler whether to display event item popover when moving mouse on an event item, default true.

eventItemPopoverTrigger

Controls Scheduler event item popover trigger, default hover. Controls Scheduler whether to display event item popover when moving mouse on an event item, default true.

eventItemPopoverPlacement

Controls Scheduler event item popover placement ('topLeftMousePosition' | 'bottomLeftMousePosition' | 'topRightMousePosition' | 'bottomRightMousePosition' | 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'), default bottomLeft.

eventItemPopoverWidth

Controls Scheduler event item popover width. Should be taken into account when you set eventItemPopoverPlacement to one of the ...MousePosition options and you set your own event item popover by setting eventItemPopoverTemplateResolver as eventItemPopoverWidth is used to determine when the event item popover content goes off the screen so the popover can be adjusted accordingly. Defaults to 300.

calendarPopoverEnabled

Controls Scheduler whether to display calendar popover when clicking on a date label in header, default true.

recurringEventsEnabled

Controls Scheduler whether to support recurring event, refer to this feature request, default true. If true, SchedulerData will filter out those template events who has a rrule string property in setEvents method, generate the recurring events in the time window, and insert them into the event array in the right orders. The recurring events generated from the same template event, all have a new id like ${templateEvent.id}-${number}, and have a recurringEventId property with the value templateEvent.id.

headerEnabled

Controls Scheduler whether to display header, default true.

resourceViewEnabled

Controls Scheduler whether to display resource view, default true.

displayWeekend

Controls Scheduler whether to display weekends in non-agenda view, default true.

relativeMove

Controls Scheduler whether to move events(only DnDTypes.EVENT type) relatively or absolutely, default true, means relatively.

minuteStep

Minute step for day view type in non-agenda view, can be 10, 12, 15, 20, 30, 60, etc, default 30.

views

Array of view that Scheduler will support.

dragAndDropEnabled

Controls whether the dragAndDrop funcionality is enabled. If false there's no need for the withDnDContext wrapper function.

SchedulerData.behaviors(See the behaviors.js for details.)

getEventTextFunc

getEventTextFunc(schedulerData, event);

Method that defines the text displayed in the event.

isNonWorkingTimeFunc

isNonWorkingTimeFunc(schedulerData, time);

Method that defines non-working time.

getSummaryFunc

getSummary(schedulerData, headerEvents, slotId, slotName, headerStart, headerEnd);

Method that defines the summary text displayed in the Scheduler cells.Refer to this example.

getCustomDateFunc

getCustomDate(schedulerData, num, (date = undefined));

Method that controls the start and end of time window when current view type is Custom, Custom1 or Custom2.Refer to this example.

getNonAgendaViewBodyCellBgColorFunc

getNonAgendaViewBodyCellBgColor(schedulerData, slotId, header);

Method that sets the background color of cells dynamically.

getScrollSpecialDayjsFunc

getScrollSpecialDayjs(schedulerData, startDayjs, endDayjs);

Method that defines the special dayjs Scheduler will scroll to automatically, when the time window contains that dayjs.

Scheduler.propTypes

schedulerData

schedulerData: PropTypes.object.isRequired;

View model of the Scheduler component, provides data.

parentRef

parentRef: PropTypes.object;

ref of the component that is the parent of the Scheduler component

prevClick

prevClick: PropTypes.func.isRequired;
prevClick(schedulerData);

Callback function fired when the left point bracket '<' is clicked.

nextClick

nextClick: PropTypes.func.isRequired;
nextClick(schedulerData);

Callback function fired when the right point bracket '>' is clicked.

onViewChange

onViewChange: PropTypes.func.isRequired;
onViewChange(schedulerData, view);

Callback function fired when the Scheduler view changed. view is a json such as { viewType: ViewType.Month, showAgenda: true, isEventPerspective: false}.

onSelectDate

onSelectDate: PropTypes.func.isRequired;
onSelectDate(schedulerData, date);

Callback function fired when a new date is selected. date is the new selected data, a string in YYYY-MM-DD format.

eventItemClick

eventItemClick: PropTypes.func;
eventItemClick(schedulerData, event);

Callback function fired when you click an event item.

updateEventStart

updateEventStart: PropTypes.func;
updateEventStart(schedulerData, event, newStart);

Callback function fired when resizing the start of the event, newStart is a string in YYYY-MM-DD HH:mm:ss format.

updateEventEnd

updateEventEnd: PropTypes.func;
updateEventEnd(schedulerData, event, newEnd);

Callback function fired when resizing the end of the event, newEnd is a string in YYYY-MM-DD HH:mm:ss format.

moveEvent

moveEvent: PropTypes.func;
moveEvent((schedulerData, event, slotId, slotName, newStart, newEnd));

Callback function fired when moving the event. slotId, slotName are the new id and name of the slot moving into, but they won't change if the SchedulerData.config.crossResourceMove is false. newStart, newEnd are the new beginning and ending of the event.

newEvent

newEvent: PropTypes.func;
newEvent(schedulerData, slotId, slotName, start, end, type, item);

Callback function fired when creating a new event, or dragging an external item and dropping it into the resource view or task view. slotId and slotName are the slot creating in or dropping into, start, end are the beginning and ending of the event. If it's a drag&drop operation, the type is the DnDType of DnDSource registered to Scheduler, and the item is the external item.

leftCustomHeader, rightCustomHeader

leftCustomHeader: PropTypes.object;
rightCustomHeader: PropTypes.object;

Component you need to put in the Scheduler header, it could be a div or a react component. Refer to this example.

conflictOccurred

conflictOccurred: PropTypes.func;
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
SchedulerData.config.checkConflict is true.

eventItemTemplateResolver

eventItemTemplateResolver: PropTypes.func;
eventItemTemplateResolver(schedulerData, event, bgColor, isStart, isEnd, mustAddCssClass, mustBeHeight, agendaMaxEventWidth);

Use this function, you can customize the event style. Refer to this example.

eventItemPopoverTemplateResolver

eventItemPopoverTemplateResolver: PropTypes.func;
eventItemPopoverTemplateResolver(schedulerData, eventItem, title, start, end, statusColor);

Use this function, you can customize the event's popover style. Refer to this example.

slotItemTemplateResolver

slotItemTemplateResolver: PropTypes.func;
slotItemTemplateResolver(schedulerData, slot, slotClickedFunc, width, clsName);

Use this function, you can customize the left slot style.

nonAgendaCellHeaderTemplateResolver

nonAgendaCellHeaderTemplateResolver: PropTypes.func;
nonAgendaCellHeaderTemplateResolver(schedulerData, item, formattedDateItems, style);

Use this function, you can customize the table header cell style. Refer to this example.

onScrollLeft, onScrollRight

onScrollLeft: PropTypes.func;
onScrollLeft(schedulerData, schedulerContent, maxScrollLeft);
onScrollRight: PropTypes.func;
onScrollRight(schedulerData, schedulerContent, maxScrollLeft);

Callback function fired when the scheduler content div scrolls to leftmost or rightmost. Refer to this example.

onScrollTop, onScrollBottom

onScrollTop: PropTypes.func;
onScrollTop(schedulerData, schedulerContent, maxScrollTop);
onScrollBottom: PropTypes.func;
onScrollBottom(schedulerData, schedulerContent, maxScrollTop);

Callback function fired when the scheduler content div scrolls to topmost or bottommost. Refer to this example.

slotClickedFunc

slotClickedFunc: PropTypes.func;

If it's set, slots will be clickable, and will fire this function when a slot is clicked. Refer to this example.

dndSources

dndSources: PropTypes.array;

DnDSource array that registered to Scheduler. Use DnDSource, we can simplify the drag and drop coding in React-Big-Scheduler. Refer to this example.

onSetAddMoreState

onSetAddMoreState: PropTypes.func;
onSetAddMoreState(newState);

Callback function fired when a '+N more' is clicked, is used to control the visibility and the position of the AddMorePopover. newState is a json such as {headerItem: headerItem, left: 20, top: 20, height: 100}. Refer to this example.

subtitleGetter

subtitleGetter: PropTypes.func;
subtitleGetter(schedulerData, event);

Use this function, you can display a subtitle in the EventItemPopover.

viewEventClick

viewEventClick: PropTypes.func;
viewEventClick(schedulerData, event);

Callback function fired when you click one operation link in the EventItemPopover. The operation link won't appear if this function isn't set.

viewEventText

viewEventText: PropTypes.string;

Text of one operation link in the EventItemPopover. The operation link won't appear if this text isn't set.

viewEvent2Click

viewEvent2Click: PropTypes.func;
viewEvent2Click(schedulerData, event);

Callback function fired when you click the other operation link in the EventItemPopover. The other operation link won't appear if this function isn't set.

viewEvent2Text

viewEvent2Text: PropTypes.string;

Text of the other operation link in the EventItemPopover. The other operation link won't appear if this text isn't set.

react-big-schedule's People

Contributors

ansulagrawal avatar damyanbg avatar dependabot[bot] avatar jitendrasoni1234 avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-big-schedule's Issues

Cannot read properties of undefined (reading 'time') or (reading 'end')

Checklist

  • I've verified that I'm running react-big-schedule latest version.

Describe the bug

When I click on an empty area in calendar, I see the below error message

image

image
For example, if I click on the grey area below 3/12.

Sometimes, the error says reading 'end'. Below is the error in the console:

image

As a workaround, I am okay to just disable clicking in empty area in calendar but I don't see any such prop that allows me to do that.

Reproduction Link/Code

I am just using the example in the repository.

Steps to reproduce

  1. Tap on the empty day
  2. Observe the error

Operating System

Mac

Browser

Edge

React version

18.2.0

react-big-schedule version

4.4.0

Additional Information

No response

setSchedulerLocale & localeDayjs.locale not working

Checklist

  • I've verified that I'm running react-big-schedule version 4.2.0 or higher

Describe the bug

The localization of the date items are not working.

Reproduction Link/Code

I have tried this configurations:

import * as dayjsLocale from 'dayjs/locale/nl';
schedulerData.setSchedulerLocale(dayjsLocale);

and

schedulerData.localeDayjs.locale('nl_NL');
schedulerData.setSchedulerLocale('nl_NL');

and

schedulerData.localeDayjs.locale('nl');
schedulerData.setSchedulerLocale('nl');

Nothing happend, also no error's. Also tried to use the br-pt local, but also not changing.

Steps to reproduce

See above.

Operating System

Mac

Browser

Chromium

React version

18.2

react-big-schedule version

4.2.1

Additional Information

No response

Request for Assistance in Converting Project to TypeScript

I would like to request assistance in converting my project to TypeScript. As I am currently learning TypeScript, my knowledge in this area is limited. Therefore, I am seeking the help of someone who is knowledgeable in TypeScript to guide me through the conversion process. I greatly appreciate any support that can be provided. Thank you in advance for your help.

Example for running the basic version using React Hooks

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

Hi, Is it possible to have an example of how to use this in React Hooks?

thx!

Find alternative of react-dnd and react-dnd-html5-backend

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

This feature will help to find better solution for the core functionality of the library.

Proposed Solution

My first solution in mind is to implement our own drag and drop functionality.

Benefits

Better maintenance.

Alternatives Considered

No response

Additional Information

No response

How do I use DND function

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

Please help me to find DND

While installing react-big-scheduler getting error

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule version 4.2.0 or above.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

I was using react-big-scheduler, in that package we faced event display issue if we create event before 5:30 AM.
As per your suggestion I tried to install react-big-schedule package.
Old package was deleted with all the references.
Installed react-big-schedule package.
while gulp build facing error.

Please find below error -

[13:28:39] Error - [tsc] node_modules/react-big-schedule/dist/index.d.ts(129,20): error TS1110: Type expected.
[13:28:39] Error - [tsc] node_modules/react-big-schedule/dist/index.d.ts(130,16): error TS1109: Expression expected.

Refactor src/components/SchedulerData from class to functional component

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

This issue is related to #48 . We want to refactor all class components to functional components.

Proposed Solution

Better

Benefits

Better

Alternatives Considered

No response

Additional Information

No response

scheduler does not conform to the outside parent div

Checklist

  • I've verified that I'm running react-big-schedule version 4.2.0 or higher

Describe the bug

The scheduler does not conform to the outside parent div no matter what I try, the second issue is that when I change the viewType, from day to week or month, the entire scheduler expands outside the div and will not look functional.

Currently the scheduler does not conform to the outside div:

266804314-cd7c7c2e-f373-4c9f-9bd0-44875642e45e

If I change to week:

image

If I rerender the component it reshapes itself back to a normal size, but its still not conforming to the outside div.

image

I have tried the

  1. responsiveByParent route hbatalhaStch/react-big-scheduler#26
  2. #52
    Which is running react not in strict mode, my production version has the same identical issues.
  3. besidesWidth: window.innerWidth <= 1600 ? 100 : 350, // you need to add this

None have worked so far, from my understanding it seems that the resource table have a dynamic width that increases its size dependent on the width rather than the events table.

What could it be and what should I be trying? I would really like this to work in my application.

Reproduction Link/Code


  const schedulerParentRef = useRef();
  var today = new Date();
  var date = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
  let schedulerData = new SchedulerData(
    date,
    ViewType.Day, // Change the status of daily, weekly or monthly
    false,
    false,
    {
      eventItemPopoverPlacement: "bottomRightMousePosition",
      responsiveByParent: true,
      besidesWidth: window.innerWidth <= 1600 ? 100 : 350,
      startResizable: false,
      endResizable: false,
      schedulerContentHeight: "100%",
      weekCellWidth: 80,
      dayCellWidth: 40,
    }
  );
  schedulerData.setResources([]);
  schedulerData.setEvents([]);

  useEffect(() => {
    dispatch(initialiseViewModel(schedulerData));

    return () => dispatch(reInitialiseViewModel());
  }, [date, dispatch, initialiseViewModel, reInitialiseViewModel]);

  const changeDate = (e) => {
    setDateState(e);
  };

  const getResources = useCallback(() => {
    getAuthorization()
      .get(`company/get_companyschedule_recources?assigned_to=${DropDownValue}`)
      .then((res) => {
        setResources(res.data.message ? [] : res.data);
        dispatch(setAPIDetailsUser(res.data.message ? [] : res.data));
        getEvents(); // Get events after resources have been set
      })
      .catch((err) => {
        console.log("Error in getting schedule", err);
      });
  }, [dispatch, DropDownValue]);

  const getEvents = useCallback(() => {
    getAuthorization()
      .get(`company/get_companyschedule_events?assigned_to=${DropDownValue}`)
      .then((res) => {
        setEvents(res.data.message ? [] : res.data);
        dispatch(setAPIDetailsUserEvents(res.data.message ? [] : res.data));
        setDataLoaded(true); // Set dataLoaded to true after both resources and events are set
      })
      .catch((err) => {
        console.log("Error in getting schedule", err);
      });
  }, [dispatch, DropDownValue]);

  //Set Scheduler Data
  useEffect(() => {
    if (dataLoaded) {
      viewModel.setResources(Resources);
      viewModel.setEvents(Events);
      dispatch(setViewModel(viewModel));
      setDataLoaded(false); // Reset after processing the loaded data
    }
  }, [dataLoaded, Resources, Events, DropDownValue]);

  useEffect(() => {
    setDataLoaded(false); // Reset the dataLoaded state before fetching
    getResources();
  }, [DropDownValue, getResources]);

  const prevClick = (schedulerData) => {
    schedulerData.prev();
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const nextClick = (schedulerData) => {
    schedulerData.next();
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const onSelectDate = (schedulerData, date) => {
    schedulerData.setDate(date);
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const eventClicked = (schedulerData, event) => {
    setOpen(true);
    getAuthorization()
      .get(`company/schedule_view/${event.id}/`)
      .then((res) => {
        setScheduleDetails(res.data);
        setDateState([new Date(`${res.data.start_date}`), new Date(`${res.data.end_date}`)]);
      })
      .catch((err) => {
        console.log("Error in getting schedule details", err);
      });
  };

  const ops1 = (schedulerData, event) => {
    setOpen(true);
    getAuthorization()
      .get(`company/schedule_detail/${event.id}/`)
      .then((res) => {
        setScheduleDetails(res.data);
      })
      .catch((err) => {
        console.log("Error in getting schedule details", err);
      });
    // alert(
    //   `You just executed ops1 to event: {id: ${event.id}, title: ${
    //     event.title
    //   }}`
    // );
  };
  
    return (
    <div className="w-full" ref={schedulerParentRef}>
      {displayTimeline && (
        <div className="-mt-4" style={{ marginLeft: "auto" }}>
          <Scheduler
            parentRef={schedulerParentRef}
            schedulerData={viewModel}
            prevClick={prevClick}
            nextClick={nextClick}
            onSelectDate={onSelectDate}
            onViewChange={onViewChange}
            eventItemClick={eventClicked}
            viewEventClick={ops1}
            viewEventText="Details"
          />
        </div>
      )}

Steps to reproduce

  1. view scheduler and notice that its not the right size
  2. click on week and it jumps outside of the div

Operating System

windows

Browser

firefox

React version

^18.0.2

react-big-schedule version

^4.2.5

Additional Information

No response

clone.localeData is not a function crash on calendar popover

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule version 4.2.0 or above.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • [] I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

I am currently getting crashes when I try to open the calendar popover, I have set the locales as well according to the documentation but that didnt work and I have done it without it as well. It has been fairly temperamental because very rarely it did work fine, I cant recreate or remember what the situation was when it was working fine sadly.

I have noticed that it works fine in react-big-scheduler-stch, but it crashes the website in here, presumably because of the addition of dayjs, below is my code:

  const dispatch = useDispatch();

  const schedulerParentRef = useRef();
  var today = new Date();
  var date = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
  let schedulerData = new SchedulerData(
    date,
    ViewType.Day, // Change the status of daily, weekly or monthly
    false,
    false,
    {
      eventItemPopoverPlacement: "bottomRightMousePosition",
      responsiveByParent: true,
      besidesWidth: window.innerWidth <= 1600 ? 100 : 350,
      startResizable: false,
      endResizable: false,
      schedulerContentHeight: "100%",
      weekResourceTableWidth: window.innerWidth * 0.1,
      dayResourceTableWidth: window.innerWidth * 0.1,
      monthResourceTableWidth: window.innerWidth * 0.1,
      yearResourceTableWidth: window.innerWidth * 0.1,
      weekCellWidth: 80,
      dayCellWidth: 40,
    }
  );
  schedulerData.setResources([]);
  schedulerData.setEvents([]);
  
    const prevClick = (schedulerData) => {
    schedulerData.prev();
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const nextClick = (schedulerData) => {
    schedulerData.next();
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };

  const onSelectDate = (schedulerData, date) => {
    schedulerData.setDate(date);
    schedulerData.setEvents(Events);
    dispatch(setViewModel(schedulerData));
  };


      <div className="w-full" ref={schedulerParentRef}>
      {displayTimeline && (
        <div className="-mt-4" style={{ marginLeft: "auto" }}>
          <Scheduler
            parentRef={schedulerParentRef}
            schedulerData={viewModel}
            prevClick={prevClick}
            nextClick={nextClick}
            onSelectDate={onSelectDate}
            onViewChange={onViewChange}
            eventItemClick={eventClicked}
            viewEventClick={ops1}
            viewEventText="Details"
          />
        </div>
      )}
  

Below is the crash error:

image

What would I have done incorrectly here? Any help is appreciated.

Is it possible to show cadences other than days on the timeline? I'd like to show weeks/months

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

Instead of
image

I'd like to be able to show weeks, e.g
image

Or other cadences, like quarters
image

Multi-day events can overwrite later scheduled events in renderer

Checklist

  • I've verified that I'm running react-big-schedule latest version.

Describe the bug

If a multi day event is included in the events set after another event then currently a bug will "overwrite" the event that appears before it when _createRenderData runs in SchedulerData.

Reproduction Link/Code

I don't have a standalone example but I believe the commented out line 1097 in SchedulerData is intended to prevent this:

// this.events.sort(this._compare);

Because the value of let pos = -1; is not being reset to -1 within the following resourceEvents.headerItems.forEach then the check that pos = -1 doesn't always run and thus pos is not updated to the correct value for multi day events.

Steps to reproduce

You need to add some events where the first event is on a specific date and the second event spans multiple days including the date of the first event.

Operating System

All

Browser

All

React version

Latest

react-big-schedule version

Latest

Additional Information

No response

Additional data fields in event and display then in eventPopover

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule version 4.2.0 or above.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

Is there a possiblity to display in popover additional data fields for events (e. g. total sales revnue, next event for same resource).

Make src/components/index.js from class to functional component

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

Better

Proposed Solution

Better

Benefits

Better

Alternatives Considered

No response

Additional Information

No response

Request for Assistance in Converting Project to functional based totally.

I have been working on my project using a different architecture, but after considering the benefits of functional programming, I have decided to switch to a functional-based approach. This transition will not only align with industry standards but also enhance the maintainability and scalability of my project.

I understand that functional programming promotes immutability, pure functions, and declarative code, which can lead to more predictable and easier-to-test applications. By embracing these principles, I believe my project will become more robust and efficient.

However, I am relatively new to functional programming and would greatly appreciate your guidance and expertise in refactoring my codebase. I am confident that with your assistance, I will be able to successfully migrate my project to a functional-based architecture.

I have already done some initial research and identified areas in my project that can benefit from functional transformations. By adopting higher-order functions, leveraging immutable data structures, and embracing functional composition, I hope to optimize the performance and readability of my code.

Once again, I want to express my gratitude for your willingness to support me in this endeavor. Your expertise and guidance will undoubtedly contribute to the success of my project. Thank you for your assistance and I look forward to working together on this functional conversion.

how do i use Drag and drop feature in react-big-schedule?

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've tested the issue with the latest version of react-big-schedule
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors

Please make sure the question is worded well enough to be understood

image

errorMsg:
(0 , react_dnd__WEBPACK_IMPORTED_MODULE_0__.DndContext) is not a function

Is it possible to have the antd ConfigProvider consumd / wrap?

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

I would like to use the Customize Design Token like described here: https://ant.design/docs/react/customize-theme.

Because this integration is using Ant Design already, it is probably easy to add?

Proposed Solution

This is a very basic example of how to use the theme / custom settings:

import { Scheduler,  } from 'react-big-schedule';
import { ConfigProvider, theme,  } from 'antd';

const App = () =>{
  const { useToken } = theme;
  const { token } = useToken();

  return(
   <ConfigProvider
                            theme={{
                                token: {
                                    colorPrimary: token.colorPrimary,
                                    colorPrimaryHover: token.colorPrimaryHover,
                                    borderRadius: token.borderRadius,
                                },
                            }}>
                            <Scheduler {...props}  />
                        </ConfigProvider>
)}

Benefits

The Scheduler got the same colors and gui setup as the rest of the antd application config.

Alternatives Considered

No response

Additional Information

No response

Refactor HeaderView component from class to functional

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

This issue is related to #48 and it is connected only to HeaderView component.

Proposed Solution

Better

Benefits

Functional programming

Alternatives Considered

No response

Additional Information

No response

How can I display a specified date range?

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

How can I display a specified date range? Like startDate=2023-12-15,endDate=2024-01-05,

Fix ESLint Errors in Several Files

In the react-big-schedule project, several ESLint errors need to be addressed to ensure consistent code quality and avoid potential bugs. The affected files are:

  1. react-big-schedule/src/components/SchedulerData.js
  2. react-big-schedule/src/components/DnDSource.js
  3. react-big-schedule/src/components/DnDContext.js

Each file needs to be reviewed and updated to comply with the project's ESLint rules. Please note the importance of not disabling the ESLint rules globally or within the files, as this might mask other potential issues.

Please use the npm run lint command after making the changes to ensure that all ESLint errors have been successfully fixed.

Thanks in advance for your attention to this issue.

Scheduler does not respect the size of the parent container. (version 4.2.1)

Checklist

  • I've verified that I'm running react-big-schedule version 4.2.0 or higher

Describe the bug

Placed the in a container and it goes out of the container.

Reproduction Link/Code

Using the grid from ant.design:


<Layout className="">
  <Sider />
  <Layout>
    <Header />
    <Content>
      <Row>
       <Col span={24}>

          .... ant tabs container / content etc ......

            <Row gutter={[32, 32]}>
                <Col span={24}>
                    <div className="schedular-container">
                        <Scheduler
                            schedulerData={schedulerData}
                            prevClick={prevClick}
                            nextClick={nextClick}
                            onSelectDate={onSelectDate}
                            onViewChange={onViewChange}
                            eventItemClick={eventClicked}
                        />
                    </div>
                </Col>
            </Row>

          .... end  ant tabs container / content etc ......

          </Col>
        </Row>
      </Content>
  </Layout>
</Layout>

Steps to reproduce

While resizing the window browser it adjust the table width the same as window size, and it does not take the sidebar into account.

Operating System

MAC OSX

Browser

Chromium engine / Safari

React version

18.2.0

react-big-schedule version

4.2.1

Additional Information

No response

Import { Scheduler } not working in typescript / nextjs

Checklist

  • I've verified that I'm running react-big-schedule version 4.2.0 or higher

Describe the bug

When importing the modules in a typescript / nextjs environment, there is an error with importing Scheduler. When imported as the Default import (i.e) outside the bracket, we get this error when running the app:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

However if its imported as a named export we dont get an app error, but we get a TS error:

Module '"react-big-schedule"' has no exported member 'Scheduler'.

We work within a strict TS environent so any help would be greatly appreciated!

Reproduction Link/Code

https://github.com/Cambrai2/react-big-schedule

Steps to reproduce

reproduceable by running:

npm create t3-app@latest

and importing the react-big-schedule and trying to use.

Operating System

Linux

Browser

Chrome

React version

18.2.0

react-big-schedule version

^4.3.2

Additional Information

No response

Example with redux

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule version 4.2.0 or above.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

Hello, Is it possible to have an example of how to use library with Redux Toolkit?

Remove react-dnd and react-dnd-html5-backend due to Lack of Maintenance

Description:
After careful consideration, we have decided to remove the dependencies on react-dnd and react-dnd-html5-backend from our project. This decision is primarily driven by the fact that these libraries are no longer actively maintained by their respective teams. As a result, relying on them poses potential risks and may hinder our ability to address future issues or introduce new features.

To ensure the long-term stability and maintainability of our project, we need to remove the dependencies on react-dnd and react-dnd-html5-backend.

Tasks:

Update package.json: Remove the entries for react-dnd and react-dnd-html5-backend from the "dependencies" section.
Remove Imports: Locate and remove any import statements related to react-dnd and react-dnd-html5-backend in the relevant files.
Refactor Components: If any components rely on react-dnd and react-dnd-html5-backend, refactor them to use an alternative drag-and-drop solution that is actively maintained and aligned with our project requirements.
Update Tests: If tests exist for components or functionality affected by this change, update them accordingly to reflect the removal of react-dnd and react-dnd-html5-backend.
By removing these dependencies, we aim to mitigate potential risks and ensure that our project remains up-to-date with actively maintained libraries. We understand that this removal may require additional adjustments to code and components, and we will perform thorough testing to ensure the stability and functionality of the application post-removal.

If you have any questions or concerns regarding this issue, please feel free to reach out. Your cooperation in removing react-dnd and react-dnd-html5-backend from our project is crucial to maintaining the project's health and sustainability. Thank you for your support.

Meeting block relative length always takes "whole day" on the week view

Checklist

  • I've looked through the README
  • I've verified that I'm running react-big-schedule version 4.2.0
  • I've searched existing feature requests and confirmed that this request is not a duplicate

What problem does this feature solve?

62401223-8c8df400-b582-11e9-8163-e12405e0fb7d

If the event is set from 10AM to 11PM same day, or 2PM today to 3PM tommorow, the tab showing existence of that event is shown as 100% fill of a day when view is set to week, or 100% fill of both days when it is a part of one day and next day (it assumes that it is "whole day" but in reality it is not, how can I show the actual graphical representation of time reserved in a day ?
I want to have more like "timeline" feel.
And i want to be able to add meeting from 2PM today to 10AM tomorrow, and next meeting from 11 AM tomorrow to 4PM tomorrow. And be able to show the relative length of the block representing that meeting in the day.

Proposed Solution

Right now we need to check on the tooltip what is the actual length of the event, and it would be much better to show it/visualize it.

Benefits

If there is an option to do that, please point me to the proper example or just tell how to do that.
I hope I have explained it clearly
Thank You

Alternatives Considered

No response

Additional Information

No response

How do i use drag and drop in react-big-schedule

Checklist

  • I've looked through the README
  • I've tested the issue with the latest version of react-big-schedule
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've provided relevant code snippets or error messages

Please make sure the question is worded well enough to be understood

https://stephenchou1017.github.io/scheduler/#/draganddrop
please visit this link
it is too complicated
i copy same code did not run and also download same file but did not install get error

ViewType.Day not displaying hour headers properly

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

for ViewType Day, only showing first hour of the day as header, all other ViewType working properly

Screenshot 2024-02-09 124432

Regarding viewType

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've included steps to reproduce the issue
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

image

in this i want only month, quarter and year in viewType how to do it?

remove title={} from resource

Checklist

  • I've verified that I'm running react-big-schedule version 4.2.0 or higher

Describe the bug

Using JSX on the resource setter:

{
                        id: element.product_id,
                        parentId: 0,
                        title: element.product_name,
                        name: <Flex justify="space-between" gap={5}>
                                <div className="product-label">{element.product_name}</div>
                            </Flex>,
                    }

The title on the resource buttons gives: [object Object]. Not sure why this title's has been set. You can find it here:

<div style={{ width }} title={resourceEvents.slotName} className="overflow-text header2-text">

and here:

<div title={item.slotName} className="overflow-text header2-text" style={{ textAlign: 'left' }}>

Possible to rename to title={resourceEvents.slotTitle} instead of using title={resourceEvents.slotName}.

Also, make more send to have this aligned using the title from the resource setter instead of the name.

Reproduction Link/Code

Scherm­afbeelding 2023-11-09 om 09 52 03 Scherm­afbeelding 2023-11-09 om 09 52 07

Steps to reproduce

Using "react-big-schedule": "^4.3.2",

Operating System

MacOSX

Browser

Chromium

React version

18.2

react-big-schedule version

"react-big-schedule": "^4.3.2",

Additional Information

No response

Scheduler width adjustment

Checklist

  • I've looked through the README
  • I've verified that I am running react-big-schedule latest version.
  • I've searched the existing issues and discussions for a similar question
  • I've provided relevant code snippets or error messages
  • I've included steps to reproduce the issue
  • I've checked the browser console for any errors
  • I've tested the issue with the latest version of react-big-schedule

Please make sure the question is worded well enough to be understood

how to adjust scheduler width as per outer div width

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.