React-big-calendar: Customize day item in month view

Created on 14 Dec 2017  路  10Comments  路  Source: jquense/react-big-calendar

Hi,
I'd like to be able to customize day container but couldn't find how to do that yet...
I tried by supplying a dayWrapper to the components props, but it didn't seem to work.
Here's an example of what I'm willing to do, the circle I drawn are representating pictures that I'd like to be displayed for each day.

capture d ecran 2017-12-14 a 10 45 54

So if you have any idea that would be great thanks!

Most helpful comment

All 10 comments

+1

I second that

You can use the dateHeader component prop for this:

<BigCalendar
  components={{
    month: {
      dateHeader: (props) => (
        <div>Custom Date Header</div>
      )
    }
  }}
/>

@tobiasandersen @jquense is there any way to make Apr 12-18 like Apr 12-18, 2018? I cant figure it out. Thanks

Use the message props

For future readers who discovered like me that @tobiasandersen 's solution didnt work for them since it removes the date from each cell, here's my solution which allowed me to add a button to each day

````
function CustomDateHeader({ label, drilldownView, onDrillDown }) {
return (

{label}



)
}

const Calendar = props => (


localizer={localizer}
events={events}
popup
startAccessor="start"
endAccessor="end"
components={{
month: {
dateHeader: CustomDateHeader
}
}}
/>

)

export default Calendar;
````

Hi, this 'dateHeader' props is working great for me! But i want to know if there's any similar props for week view and day view, thanks

@hzb-imasine you can use header instead of dateHeader

components={{
    week: {
         header: CustomDateHeader
    }
}}

@pitops @alansutherland @hzb-imasine how to do custom header for day view?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KatiaPosPago picture KatiaPosPago  路  3Comments

zhming0 picture zhming0  路  3Comments

connercms picture connercms  路  3Comments

dogC76 picture dogC76  路  4Comments

martinnov92 picture martinnov92  路  3Comments