Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NiceToHave: Could you guys give us an API to sort events by ourself own requirements? #2636

Open
3 tasks done
cheng4kn opened this issue Jul 31, 2024 · 0 comments
Open
3 tasks done

Comments

@cheng4kn
Copy link

cheng4kn commented Jul 31, 2024

Clear and concise description of the problem

First, thanks to you guys for the open-source of this wonderful project, we've got a lot of useful features in our internal OA project.

Secondly, our calendar app is similar to Google Calendar and Apple Calendar, we have two kinds of events, one is event, and the other one is task.

in our requirements, we will call RPC to add events to the calendar for our company employees. but for our high leaders like the Director, VP, or CEO.

Their calendar has many events in just one day, but the order of the events is not as ideal as we think. because the order of events now is by localizer.sortEvents algorithm and cannot be customized by any open API.

That means if we wanna change the order our way, like to make the finished event order to the last, to make the confirmed/processing event the first.

To adapt our business, we must rewrite the dayjsLocalizer.sortEvents method. But I found that sortWeekEvents and sortEvents as pass a simple event object without other properties only has:

 const evtA = {
    start: accessors.start(eventA),
    end: accessors.end(eventA),
    allDay: accessors.allDay(eventA),
  }

We hope you can pass all of the rest properties of the event object, or you can provide a customSortEvent API to make the library users can customize the sort of the events.

Suggested solution

  1. To provide a new API like customSortEvents(eventA: Event, eventB: Event)
  2. Or pass down all of the rest properties of the event object to the localizer.sortEvents API

Thanks

Alternative

No response

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant