acro5piano / react-native-big-calendar

gcal/outlook like calendar component for React Native
https://react-native-big-calendar.vercel.app
MIT License
422 stars 138 forks source link

Multiple All Days Event Color not working #995

Open omercandemir opened 7 months ago

omercandemir commented 7 months ago

In the allDaysEvents section, if the event covers more than one day completely, the custom event color is considered invalid and does not work.

<Calendar
               events={events}
                locale={'de'}
                date={currentDate}
                height={screenHeight}
                overlapOffset={30}
                onPressCell={pressCell}
                mode={'week'}
                onPressEvent={(e) => { clickEvent(e); }} 
                hourStyle={{fontSize: 14}}
                weekStartsOn={1}
                onChangeDate={(date) => {
                  setCurrentDate(date[0]);
                }}
                scrollOffsetMinutes={350}
                eventCellStyle={(event) => {
                  if (event.isGroup == 1) {
                    return ({ backgroundColor: '#303030' })
                  } else {
                    return ({backgroundColor: event.color})
                  }
                }}
              />

Simulator Screenshot - iPhone 15 - 2023-12-23 at 01 22 46

acro5piano commented 6 months ago

@omercandemir A happy new year! Sorry for my slow response. I'll leave my comments on the PR.

acro5piano commented 6 months ago

For anyone who want to control the color, please use the theme functionality.

https://github.com/acro5piano/react-native-big-calendar?tab=readme-ov-file#theme