vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
969 stars 82 forks source link

Utilities/extras module #204

Open amoscicki opened 7 months ago

amoscicki commented 7 months ago

Hi,

I am very impressed by the project and I would like to contribute by creating utilities module. I would essentially see this as a module that is not part of the core functionality but it would provide some additional useful things that may help popularize the project. The demo presenting the example setup utilizing and showcasing every available feature of the calendar could also be included in a form of exported object, so people could simply import it, and then cherry-pick options from that to build on top of those. Whilst documentation is necessity, often the case for me is that I find it much easier to understand some concepts after seeing some examples, and I think having some easy to customize "Out Of the Box" implementations and additional utilities would potentially help people when they use this inside their projects.

The idea is to improve developer experience when using the event-calendar.

My first thoughts on this is to contain the following:

If this is seen as a valid and useful idea, happy to build on it.

vkurko commented 7 months ago

Yes, I agree that the documentation lacks examples, so I'd be happy if you can make some useful demo code that can be used as a base.

amoscicki commented 7 months ago

I have created a repo to show what I have so far.

link

vkurko commented 7 months ago

By the way, it is possible to override theme for each view separately:

views: {
  dayGridMonth: {
    theme() {
      // return theme
    }
  }
  timeGridWeek: {
    theme() {
       // return theme
    }
  }
}
amoscicki commented 7 months ago

Ok, I thought that if I provide separate options object to specific view the theme prop would still trigger processing each callback for rest of the enabled views under the hood. Is that not the case?

Anyway in current form that should still work with the plugin I made (I'll test after work)

My idea is to provide ability to define single and easy to digest template config file with ability to build a theme configurator at later point, so it's easier and more convenient :).

amoscicki commented 7 months ago
 @amoscicki  i agree 100% in what you said, that would be really helpful if you’re willing to share your outcomes too. The calendar is a nice representation of the data, but generating the data should happen outside that element.

Originally posted by @steveb85 in https://github.com/vkurko/calendar/issues/28#issuecomment-1810825615

I prepared a simple example implementation for how you could potentially style your event to indicate it is recurring. I wouldn't recommend this as a production code but it would be a good starting point to grasp the idea and build on top of it. image

Code:

steveb85 commented 7 months ago

@amoscicki thanks so much for sharing! much appreciated. IT's definitely a place i can work from and get ready for production! really appreciate it! I like the eventdidMount idea!

amoscicki commented 7 months ago

one thing to mention - in this example I had font-awesome and tailwind installed.