Comments (7)
Hi @nyblad ! Thanks for your interest. Yes, you can add each cell style dynamically by passing a function to eventCellStyle
.
Like this:
<Calendar
height={600}
events={events}
eventCellStyle={event => ({ backgroundColor: event.colorCode })}
/>
See more:
react-native-big-calendar/stories/desktop.stories.tsx
Lines 60 to 67 in 41a6b00
from react-native-big-calendar.
I am using the above approach to integrate but not getting the color changed.
<Calendar
theme={darkTheme}
mode={'month'}
hideNowIndicator={false}
startAccessor="start"
endAccessor="end"
events={calendarEvents}
eventCellStyle= {(event) => {
const backgroundColor = event.reg.match(true) ? 'red' : 'blue'
return { backgroundColor }
}
}
date={date}
/>
from react-native-big-calendar.
Same analogy.
<Calendar
style={styles.calendar}
height={SCREEN_HEIGHT}
events={events}
eventCellStyle={(event) => {
const color = event.title.match(/Meeting/) ? 'red' : 'blue'
return { color }
}}
from react-native-big-calendar.
Feel free to reopen if you still have a question.
from react-native-big-calendar.
how to change text color dynamic generated event
from react-native-big-calendar.
Same analogy.
<Calendar style={styles.calendar} height={SCREEN_HEIGHT} events={events} eventCellStyle={(event) => { const color = event.title.match(/Meeting/) ? 'red' : 'blue' return { color } }}
@acro5piano how to change position of the event in event cell
from react-native-big-calendar.
@JessyAngel07 Try to set marginTop
or top
. If it does not work, try to use renderEvent
to get the full control of rendering logic.
from react-native-big-calendar.
Related Issues (20)
- Events Side by Side instead of overlapping the HOT 1
- onPressEvent not working properly
- If "isEventOrderingEnabled" is true demo example day/week views need couple of seconds to render HOT 1
- Issue with build folder HOT 3
- how to remove border between event days HOT 1
- Multiple days event are not rendered correctly, zIndex issue HOT 1
- Locale not working in schedule mode HOT 1
- renderCell Event
- event cell position problem of minHour & maxHour
- onChangeDate not called after date changed from outside HOT 6
- Use schedule mode HOT 7
- Schedule mode - color of the items HOT 8
- Diminish the difference between README and actual code
- month mode how to show month name ? HOT 1
- Month view how to show the month name? HOT 1
- in month view onchange funct cannot trigering HOT 2
- Calendar not rendered correcly
- Multiple All Days Event Color not working HOT 2
- How to change the Current day name color in month view? HOT 2
- how to show a particular timeline ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-big-calendar.