react-infinite-calendar icon indicating copy to clipboard operation
react-infinite-calendar copied to clipboard

[Feature] Displaying events

Open marek-sed opened this issue 8 years ago • 18 comments

Hi,

Is there a way to display states like birthday, federal holidays, events on each day?

marek-sed avatar Jun 01 '16 05:06 marek-sed

I think the best way to go about this would be to provide a custom day renderer function and a custom selected state renderer. This would allow for maximal flexibility. Thoughts?

clauderic avatar Jun 01 '16 14:06 clauderic

yes I was thinking something like that. Basically looking at date component at it is written now, it has 2 parts. Wrapper Component that handles click events and disabled state, and creates data needed for display component. And Display Component, which receives the needed data, and handles state('selected', 'normal'). So it would be nice if user can provide this custom display component.

What do you think?

I can implement it on weekend, if you want I need this exact functionality in my app so I can test it there.

marek-sed avatar Jun 01 '16 16:06 marek-sed

I have a pretty good idea of how I would implement it, but I'm curious to see how you would implement it. How about you take a first stab at it and we'll take it from there :)

clauderic avatar Jun 01 '16 16:06 clauderic

Yeah thats sounds like a good plan :)

marek-sed avatar Jun 01 '16 17:06 marek-sed

@clauderic @marek-sed it would be pretty neat if there was a tool-tip shown when an event is hovered on or clicked on. What do you guys think?

kennetpostigo avatar Jun 03 '16 22:06 kennetpostigo

@marek-sed @clauderic what is the status on this?

sandysaders avatar Jun 11 '16 04:06 sandysaders

Haven't heard back from @marek-sed, I'll get around to tackling this next week or so. Tooltip would be nice for sure, but I'm probably going to build the logic for this to be as abstract as possible and then provide a couple of example recipes

clauderic avatar Jun 11 '16 06:06 clauderic

Hi @clauderic @jamestwiggle , sry I went silent, was quite busy. I just issued the pull request for this.

EDIT: and broke a bunch of tests, fixing it now :) EDIT: fixed

marek-sed avatar Jun 11 '16 12:06 marek-sed

when can you release the new npm package that merged this pull request ?

Regards. @clauderic

shikelong avatar Jun 17 '16 06:06 shikelong

I'll take a look at it next week, I'm currently on vacation :)

clauderic avatar Jun 17 '16 07:06 clauderic

@clauderic I understand this may be your side project, but do you know when you will be able to support this?

hiddenl00p avatar Jul 08 '16 07:07 hiddenl00p

@clauderic any update on this?

pinder360 avatar Aug 26 '16 08:08 pinder360

@marek-sed @clauderic Also curious if this is on any one of your radar still?

oyeanuj avatar Mar 01 '17 03:03 oyeanuj

This would be fairly simple to implement with the new architecture of react-infinite-calendar@^2.0.0.

This isn't something I have bandwidth to work on at the moment, but if this is something you're interested in, you can take a look at the implementation of the withMultipleDates HOC: https://github.com/clauderic/react-infinite-calendar/blob/master/src/Calendar/withMultipleDates.js.

I think the implementation for displaying events would be fairly similar.

clauderic avatar Mar 01 '17 03:03 clauderic

I would be happy to take a stab at this, but Im new to recompose, so I could use a little help coming up to speed. Can someone please explain what this line does from the above mentioned file?

withProps(({displayDate, onSelect, setDisplayDate, scrollToDate, ...props}) => ({

I think I understand that it is doing something magical to inject props into the secret wrapper container around Calendar. Im not quite sure where those 5 arguments come from and where they are going. In particular, where is "scrollToDate" defined? Thanks!

offsky avatar Mar 01 '17 05:03 offsky

@offsky He is using destructuring to select the props that are coming before it and modifying them in some way before passing them to the wrapped component. I hope that helps.

arecvlohe avatar Aug 18 '17 18:08 arecvlohe

Is it possible to display events now? The pull request is there, but is it merged?

awb99 avatar Jul 23 '18 10:07 awb99

@marek-sed @clauderic @Makashov is this already possible? please tell me is ready! it has been two years waiting on this feature and we are in version 2.3.1

daiky00 avatar Oct 25 '18 21:10 daiky00