I am using fullcalendar and I am able to display events sourcing from a json stream with rails. https://fullcalendar.io/docs/events-json-feed
Now I would like to set the color of a specific event as it's shown in the example. I am specifying it in the json like so:
[{"id"=>101, "style"=>"Phone Call", "location"=>"", "created_at"=>Tue, 26 May 2020 14:31:08 UTC +00:00, "updated_at"=>Tue, 26 May 2020 15:17:48 UTC +00:00, "summary"=>"test", "organizer"=>"somePerson", "job_id"=>194, "start"=>Mon, 27 Jan 2020 18:00:00 UTC +00:00, "title"=>"test", "contacts"=>[], "eventColor="=>"#06fff7"}]
Note that "eventColor="=>"#06fff7" is set.
However, it always displays all events in the same color... not the one specified.
Is it possible to set the event color using the json stream?
I have played with different options such as using colro, backgroundColor etc. I have used hex values or color names (e.g. 'yellow').
No success. I really don't see what I am doing wrong.
Any help is appreciated.
=== UPDATE ===
here is the json that is received by the browser:
eventColor: "yellow"
contacts: []
created_at: "2020-05-26T14:31:08.663Z"
id: 102
location: ""
organizer: "som eperson "
start: "2020-01-27T18:00:00.000Z"
style: null
summary: "test"
title: "test"
updated_at: "2020-05-26T14:31:08.738Z"
the information is displayed properly. However, the color is not recognized.
I am initializing the calendar like so:
var calendar = new Calendar(calendarEl, {
header: { center: 'dayGridMonth,timeGridWeek,listMonth' },
plugins: [ listPlugin, timeGridPlugin, dayGridPlugin, bootstrapPlugin ],
defaultView: 'dayGridMonth',
height: 'auto',
width: 'auto',
editable: true,
scrollTime: '08:00:00',
themeSystem: 'bootstrap',
events: '/jobs/' + jobId + '/interviews.json',
}
I removed the bootstrap theme to see if that makes a difference but it does not.